Set icon of USAGE device to OFF

Python and python framework

Moderator: leecollings

Post Reply
Filip
Posts: 110
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Set icon of USAGE device to OFF

Post 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,
User avatar
waltervl
Posts: 5859
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Set icon of USAGE device to OFF

Post by waltervl »

Normally this is done by creating a state switch by the plugin that displays the state (On/Off)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Filip
Posts: 110
Joined: Thursday 03 November 2016 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Set icon of USAGE device to OFF

Post 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).
User avatar
waltervl
Posts: 5859
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Set icon of USAGE device to OFF

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest