Could anyone point me to an example where it is shown how to get the status indicator for a system device capability that is not prefixed with alarm, measure or meter?
I have implemented 2 new drivers with Johan B’s Tuya Zigbee app, one for controlling ceiling fans (TS0601 _TZE204_lawxy9e2):
Where you can control the light on/off as well as the fan on/off and the fan speed.
I use it for my ceiling fan, but also to control my house ventilation as it dawned on me that I have quite some some savings if I don’t run it full blast all the time but make it regulate based on inside/outside temperature and inside/outside humididty.
It is all all working now and to monitor it is nice to be able to show the fan speed/ ventialtion speed in the device tile. Right now I have created a “dummy” custom capability that is based on the Homey supplied device capability fan_speed, just prefixed with measure_fan_speed, but this is so ugly when in fact all I want is to get the fan speed as a status indicator.
This is how it looks right now, with my “dirty fix” (waiting for the icon from homey-vectors):
The second one I have implemented is a Tuya Garage Door Controller (TS0601 _TZE204_nklqjk62):
Same here I would like to be able to show in the device tile if the door is open or closed. Here too I am using the Homey supplied device capability garagedoor_closed which is a boolean, but the only way I can figure out to be able to display the fan speed is to create another dummy capability prefixed with alarm for it to be selectable as a status indicator.
This is really ugly there must be a better way I think since I see this type of functionality with for instance my Danalock APP, but I have been unable to find an example of how it was done.
I would like to have the garagedoor_closed built in pictures as the status indicator, like what is done in the Danalock app.
I cannot find a place where this is described in the documentation nor have been able to find an example where it is done.
Anyone has any ideas or could point me to an example of how this could be done?
There are only icons for built in capabilities like measure_battery (green battery icon) and locked (lock icon).
It’s not possible to set a custom icon for a custom capability. It’s just a visualization in the GUI…
If it’s a numeric capability, the number is shown.
If it’s a string capability, the text is shown.
Enum capabilities are not selectable. I already requested to show the title of current capability/enum value but that won’t be added soon.
Thanks Ronny!
This is the conclusion I came to as well after spending quite some time to trying to find a solution.
I thought that it would make sense for at least the system/Homey included capabilities to also show up by default as status indicators, like fan_speed and garagedoor_closed that I am using here, but I was wrong.
I had not thought about the locked built in capability, that one is not mentioned in the Homey documentation as a potential status indicator…
Thanks for the idea I think that it will do to show if the door is open or closed somehow.
I had what is in the garagedoor_closed capability in mind as a status indicator:
I think the locked will do ok even though it is not as illustrative as the garage one!!
Device Indicators and Custom Capabilities
The Homey web app and mobile app can display indicators next to the device icons. This gives users the ability to view a specific capability, such as a temperature value or battery status, at a glance. Custom boolean and number capabilities can also be shown as indicators as device indicators.
Boolean Capabilities
Boolean capabilities, also called Alarms in Homey, are displayed in two different ways if they start with the prefix alarm_. By default all capabilities with this prefix are grouped, and a warning icon is shown if the value of any of the boolean capabilities is true. Alternatively users can choose to show the indicator value of a single specific Alarm capability. The alarm_battery capabilities will show an “empty battery” icon instead of an exclamation mark.
Number Capabilities
Number capabilities, are displayed as a numeric value together with the unit of the capability. Users are able to select capabilities that start with either the prefix measure_ or meter_. The measure_battery capability will always be displayed with a custom battery icon instead of a number.
The icons are only used on buttons/switches in device details.
You could also use an alarm capability that shows an exclamation icon if it’s true (e.g. warning if door is open).
Any idea as to why it doesn’t show the locked padlock in the device tile now when I have added the locked capability to me driver (developer tools snippet)?
I added the code to update that capability in synch with the garagedoor_closed capability and it toggles nicely., but still doesn’t show up in the device tile.
I deleted and re-paired the controller as well, but no change.
Do you think it may be due to that I have both these capabilties defined? Seems like a bug in Homey to me if so?
Or did I miss something else? I see for my Danalock for instance locke does not even show up as a status indicator option it just comes there by default. May be I should re-write my drive not to use the “useless” garagedoor_closed capbility at all and only use locked?
But that will be quite some updating I think, will give it a try later when I get some energy.
Tried removing the garadorr_closed capability and only use the locked capability, but for some reason I don’t get the padlock status indicator anyway. Tries removing and re-paring as well.
Maybe a Homey restart would do it? Will try that as well.
In Homey developer tools I only have this now:
Restarting with my garagecontroller removed and then re-paring didn’t make any difference either.
The danalock stopped working after it all, but restarting that app “fixed” the problem…
Anyway I am out of ideas how to make this work. Everything else in my garage door controller looks exactly the same as the danalock device tile, now the transaction history open/close is logging as well. So all is good except for the status indicator that is nowhere to be found…
Aaah that was it!! Now it is working as it should!!
I totally missed that when changing quickly, was getting a bit frustrated:-).
I spent quite some time on this driver to reverse engineer how it works an then I only had this “little” thing to fix…
I hould have seen this of course, but I was expecting all along to get garagedoor one there.
Thanks a lot Ronny, this is the kind of help that makes a difference!!