changer icone via json
Publié : 01 déc. 2016, 12:02
bonjour, je voudrais savoir si l'un d'entre vous a déjà changé l'icone d'un device par une autre via le json comme on le ferait pour une valeur?
merci
merci
Reprenez le contrôle de votre domotique
https://easydomoticz.com/forum/
Code : Tout sélectionner
if moonPhase=="Waning Crescent" then
moonPhaseIdx = 8
moonPhaseIcon = 110
moonPhase = "Afnemende halve maan"
end
-- Because there is no api command available to set a custom icon a JSON call is made
-- This requires the following parameters:
-- type = setused (not to be changed)
-- idx = idxmoonphaseicon (not to be changed here)
-- name = Maanfase (This is the Name of the control. You need to pass this value. This name will be displayd in the Domoticz GUI.
-- description = (left empty: no need for a description in the Domoticz GUI)
-- switchtype = 0 (not to be changed)
-- customimage = moonPhaseIcon (not to be changed here)
-- devoptions = 1;%20 (This is the 'axis-label'. Because only a number is sent a space (%20) is given as axis-label, resulting in no axis-label in Domoticz GUI (not to be changed)
-- used = true (not to be changed)
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"')
print("Phase:\t"..moonPhase)
dont je ne comprends pas l'histoire du internal number,je comprends bien qu'il faut faire 8 jeux d'icones mais ou trouve t'on le "internal number"8 custom icon sets (http://domoticz-icon.aurelien-loyer.fr/) for the moonphase icons
-- note: Only the first (or 'on') icon of a custom iconset is used, so you need 8 different sets of custom icons
-- The icons are referenced by their internal number.
si tu n'utilise pas le capteur "Alert" tu peux modifier les images pour mettre celle que tu veuxhiggins91 a écrit :je suis intéressé pour indiquer la couleur tempo de mon abonnement EDF !