Send a fixed command

To the DTHs “Min Smart Plug” and “Min Smart Plug Dimmer
After I change any preference’s item or check any preference’s item(no changed) and exit from the preference, the update command for paddle control is sent.
I check the DTHs, and do not know why the command is sent fixly everytimes.
Who can help me? Thanks!

The update() function is called when the preferences are changed, this way, you can get the new value and send it to the device.

When you exit from the preference without change, do you click on “Cancel” or “Done”? (Others have “Ok” instead)

If you want to execute certain actions based on the preferences change, you can use the persistent store to compare the old and new values eg. state.preference

I click “Done” when I exit from the preference without change.

The “save” or “done” button is not enabled until you delete the previous value in the preference, for example with the “number” type.
In that case, you need to click on “cancel”

Or, when using the enum type tap on the “back” option on your mobile device, Eg.
image

:sweat_smile:Oh, My focus point is that no matter what I manipulate in preferences, or just go in and take a look,
The command to refresh the “Paddle Control” will be sent. The fact is that we rarely change this option.
Now I am tracking the cause of this problem.

It seems that the function isButtonAvailable does not work in the DTHs “Min Smart Plug ” and “Min Smart Plug Dimmer
When New One Outlet is paired, the function getAlternativeLedOptions return ledOptions1–it should be ledOptions0.
We expect to differentiate products through device.rawDescription in order to achieve the purpose of DTH merger. Obviously, the expected effect is not achieved. what should I do now?

The preference display can not be dynamically configured using isButtonAvailable, it is fixed. Therefore, if the preference‘ item is changed, it can only be judged when reading and writing it. At this time, isButtonAvailable is available.

Yes, we previously discussed that preferences are not dynamic:

The use case you mention - having a single device handler for two device models that only differentiate in some features (preferences, capabilities) can be achieved using Edge drivers as you can assign a different device profile for each fingerprint.

I create a driver for my Z-Wave device with SmartThings Edge(it is my first time to try). When I try to run it in my IntelliJ. An error report as below:


The official smaple project has the same error report:

How to solvle this problem?
I beat that there was no that error when I tried the offical sample a month ago.

I download the last official samples and compile them with the guide
There are the results:


I can not understand why there is an error reported. The CLI is the last version.

I solve the problem:
If a preference item has a “name” element, all other preference items must also have this element. In the same way, other elements cannot appear in a preference item alone. Once this happens, the compiler will report an error.

The “name” property is important because you can retrieve the preference value using it, Eg. device.preferences.preferenceName.
Take a look at the different preference configurations here:

Yes, but in the official sample “aeotec-multisensor”, the profile has no “name” property.The project should be updated.

Thank you for bringing this up to our attention. I’ll notify the corresponding team

I have created my driver with SmartThings Edge.
But after I install it and pair the device.It look not like as before:


The device “New One Outlet” is paired with new drive
The device “ZW96S-20210817” is paired with old drive

I am not sure if this display is normal.

The main interface display effect are as follows:

The interfaces of “ZW96S-20210817” and “New One Outlet” are too different. They should have similar interfaces, right?

Fortunately, the display in the preferences has achieved the effect I expected for “New One Outlet”

@nayelyz Can you help me? What’s wrong with my driver ?

Where can I find the document about categories and metadata in device profile?

Sorry for the late response, @chenjun.
This issue is generally caused by an inconsistency in the device presentation. I see you set generic-switch in the VID, but this presentation doesn’t include the capabilities “refresh” and “healthCheck”, if you want to use this presentation, you need to remove them.
Just as a reference, assigning a VID is not necessary for Edge drivers as one is generated automatically (even if your profile is using custom capabilities) unless you want a custom configuration (order, use an standard presentation, etc.)

The existing categories are listed in the device profiles manager of the Developer Workspace when you create a new one.
Which kind of information do you need about the metadata?

1 Like

Thank you very much!

I find there is no any info about “vid” and “mnmn” in the official repository

So I guess that the two items are not necessary in the SmartThings Edge driver.

I find that the elements “deviceType” “deviceTypeId” and “ocfDeviceType” will change the deivce’s icon in ST app(After setting, the device category setting in Develpoer Workspace does not seem to work. )

But I find in the official repository, they are not set in all edge drivers.

I’m not sure if they have to be set, I set it myself, and I don’t know if they are correct.

This is the first time I know about the tool, and it can save a lot of time for me to create a profile.

No, they are not necessary unless you want to make some custom configuration to the device presentation. Eg. changing the range of a capability value.

Sorry for the confusion, that tool is only for you to see the categories (temporarily, I already reported that we need more info about them in the developer docs), but the profile you use in the driver is not created there.

No, because they shouldn’t be necessary, the engineering team is checking the issue with the categories to set the device icon.

Here’s a list of different values you can set in the properties “deviceType” “deviceTypeId” and “ocfDeviceType”:

1 Like

Thank you very much!You let me know a lot of the deviations in my previous understanding.

1 Like

Happy to help! Let me know if you have other questions :smiley: