selector swich Icon

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
User avatar
TiXav
Posts: 41
Joined: Saturday 28 November 2015 22:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

selector swich Icon

Post by TiXav »

Is it possible to add different icon for each level of selector device feature ?

today I am using this code (find it with firefox dev tools) to update the icons of 2 selector devices (color of electricity cost for today and tomorow), but I am not sure tomorow the API will not change, I think it is a temporary solution :

Code: Select all

if ( xchangename == 'TempoEDF' or xchangename == 'TempoDemain' ) then
		
		--change icone
		if ( xchangename == "TempoEDF" ) then 
			dindex="290"
		else 
			dindex="302"
		end
		
		iconval=""
		
		if (xchangeval=="Off") 	then iconval="9"	end
		if (xchangeval=="Bleu") 	then iconval="165"	end
		if (xchangeval=="Blanc")	then iconval="166"	end
		if (xchangeval=="Rouge") 	then iconval="167"	end
			
		commandArray['OpenURL']="http://localhost:8080/json.htm?type=setused&idx="..dindex.."&name="..xchangename.."&description=&strparam1=&strparam2=&protected=true&switchtype=18&customimage="..iconval.."&used=true&addjvalue=0&addjvalue2=0&options=TGV2ZWxOYW1lcyUzQU9mZiU3Q0JsZXUlN0NCbGFuYyU3Q1JvdWdlJTNCTGV2ZWxBY3Rpb25zJTNBJTdDJTdDJTdDJTNCU2VsZWN0b3JTdHlsZSUzQTElM0JMZXZlbE9mZkhpZGRlbiUzQWZhbHNlJTNC"	
	end
note : I am french so sorry for my poor english
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest