Change icon on Selector Switch

Moderator: leecollings

Post Reply
Domange
Posts: 6
Joined: Wednesday 16 March 2016 14:53
Target OS: Linux
Domoticz version:
Contact:

Change icon on Selector Switch

Post by Domange »

Hu,

I think all is said...

I have a selector switch and the only icon I can have is an On/Off one...

Is it posible to have different icons dependeing on the current level ?

Thank you
Runs fine on ODroid N2 4Gb Ubuntu 18.04 LTS except V2020.1
keson
Posts: 4
Joined: Sunday 19 February 2017 11:07
Target OS: Linux
Domoticz version: 2021.1
Location: Czech
Contact:

Re: Change icon on Selector Switch

Post by keson »

Hi. Did you ever get solution for your question?
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Change icon on Selector Switch

Post by DAVIZINHO »

Hello, sorry for the up,
but this is a interesting question
i have a selector switch and will be very usefull if i can design a icon for value 10, other for 20, etc.... like the temperature icon.

its is posible???
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Change icon on Selector Switch

Post by Nautilus »

No it is not possible at the moment. Some workarounds exist: viewtopic.php?f=31&t=107#p100598 look especially into this line in the lua script:

Code: Select all

os.execute('curl -s -i -H "Accept: application/json" "http://"'..DOMO_IP..'":"'..DOMO_PORT..'"/json.htm?type=setused&idx="'..idxmoonphaseicon..'"&name=Maanfase&description=&switchtype=0&customimage="'..moonPhaseIcon..'"&devoptions=1;%20&used=true"')
So you could setup a lua script that is triggered when the level changes and it would update the icon (already uploaded) based on the new level. But I think it require you to reload the page before it is updated, not sure though. If someone has the skills, it would of course be a nice contribution to allow custom icons for all device types and as a follow up to that, a custom icon based on the switch status, at least for selector switches :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest