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