It’s still a mystery what they were referring to there, but sounds intriguing! Maybe it could help, I don’t know.
The profile change is definitely an alternative way to handle it; my only concern is, would it actually work in the iOS mobile app; would the presentation dynamically change like that?iPhones don’t seem to be too good with that type of thing. I’ve got a capability presentation I’ve changed DAYS ago that’s STILL not displaying with those updates…even if I create a new device, or delete and reinstall the driver altogether and create a new device! (or unload and reload the ST app, etc. etc… same old problems)
On Android it is working quite well, since now it is only necessary to clear the cache of the app the first time the profile is changed, then the capabilities are shown and disappear just by closing the app and reopening it.
On the other hand,
What I have noticed today is that three times a driver has been left hanging when installing a new version with the CLI and device running. Having to uninstall the driver from hub and reinstall it.
This hadn’t happened to me in a long time. I don’t know if it has to do with the Beta 041.x firmware version. I’ll keep an eye on him.
This happens to me CONSTANTLY, and is my biggest issue with Edge at this point. For me, with LAN drivers, if the driver re-install does proceed, it is often stopped by a cosock error and then goes into an infinite re-install loop. I was SO disappointed this wasn’t fixed with the new firmware…
Although, I need to ask the team for more details, as it didn’t work with the thermostatMode capability but maybe it was caused by something specific in it.
Please, let me know if you find something strange.
This property is used in the device-configuration, you can find more details about it in the API reference documentation > create device-configuration. Open the sub-menu in Detail View and you’ll find the supported operators inside visibleCondition
(Developer Support Team)
split this topic
I have a switch device where I am displaying a numeric value for the state on the dashboard. Unfortunately this is disabling the active/inactive state changes of the dashboard icon since the state isn’t the switch’s on/off state. However I still want the active/inactive icon to work based on the state of the switch. Is there any way to do this?
I was thinking that if it was possible to show 2 items for state - both the switch state and my numeric value, then maybe the dashboard active/inactive icon would work? In the device configuration API it shows that the dashboard state section is an array, so does that mean you can indeed have more than one state displayed on the dashboard? But I don’t know if this would fix the active/inactive problem…
You can definitely show more than one state in the dashboard view, and, last time I checked the icon reacted to the first state configured.
You can display different states in the dashboard by separating them into groups.
Remember the text in group will identify which capabilities belong to the same one and it’s the text that will be displayed as their title.
I remember that changes to that text weren’t considered a modification in the presentation, so be careful with them and put the right name to avoid issues
The group name is what shows where Temperature, Humidity, etc are in the screenshot. One group has to be main, which shows up top where motion is in the screenshot. I believe only one state and one command are allowed per group. Inactive/active status for each group happens independently.
It also helps you identify which capability in states can be grouped with the capability in actions
Despite a capability being in the dashboard.state section and the other in actions, they are put together because they belong to the same group. Consider this layout (VID: 2056d8b1-da5a-3248-ae51-e56f049b2906):
Wow this creates a huge tile!! Is there anyway to control the size? I have just the two states, so it seems to be a lot bigger than it needs to be…
By the way, something I wanted to report was that there is a significant delay in the state units getting updated on the dashboard. The value updates right away, but the units don’t update at the same time. Instead it seems to take a more significant app refresh to get the right one to appear.
The user can change the units displayed for a value via a device preference setting. The driver includes the unit value whenever it does an emit. So if user chooses a different unit value, the dashboard isn’t changing right away even though there have been new emits with the new unit value
I wanted to share something that might be useful to other developers that create custom capabilities:
In certain cases I wanted to use a toggle switch to turn something on or off, but I wanted a third “pending” state shown in the switch label when the switch was initially pressed. When the device actually comes back and confirms it successfully turn ‘on’, THEN I wanted the switch label to say ‘On’ or something more specific.
In other words:
Switch Action Switch Label
on 'Turn On Action pending...'
off 'Turned Off'
The way the switches work has prohibited me from doing this. They don’t like anything besides the binary on/off state.
So now that multiple attributes are supported I had the idea to create a second attribute that I would set with the label text that I wanted. And in the presentation for the switch state label, I specify my second attribute string value instead of the switch value. The driver takes care of setting both the switch state and label value in the command handler function.
And it all seems to work! The switch remains in the highlighted ‘on’ state during both the ‘pending’ and ‘confirmed on’ as I wanted it to be.
The trick is not to mess with the command or switch state part of the capability and presentation definition. Just add a second string attribute and use it as the switch state label.