Page 1 of 1

Set icon of USAGE device to OFF

Posted: Friday 20 October 2023 12:04
by Filip
I have a plugin, using USAGE, VOLTAGE, ... devices.
As the devices can be used to drive different equipment, the custom icons are not part of the plugin. They are uploaded with the GUI and changed by editing the device.
I am looking now to switch the icon to "OFF" state (eg when there is no power).
So far this would only be possible with a workaround creating another set of customer items (inverse logic).
But this means that the icon switch must be driving by the plugin. While the plugin has no knowledge about which icon is used.

Is there any possibility to change the icon to "OFF" for such devices?

Thanks,

Re: Set icon of USAGE device to OFF

Posted: Friday 20 October 2023 12:06
by waltervl
Normally this is done by creating a state switch by the plugin that displays the state (On/Off)

Re: Set icon of USAGE device to OFF

Posted: Friday 20 October 2023 12:37
by Filip
Indeed, but a device with typename "usage" has no state on/off...
Ideally when not consuming it should use the "off" state of the icon (at least this is what I want to achieve).

Re: Set icon of USAGE device to OFF

Posted: Friday 20 October 2023 13:23
by waltervl
That is not how Domoticz was designed. State of devices is shown in a on/off or other switch type device.
See for example
https://www.domoticz.com/wiki/Dummy_for ... h_Subtypes