Je rencontre un probleme par rapport a mon script lua concernant le changement toutes les 5 minutes de la couleur de ma lampe hue go. Le script fonctionnait parfaitement mais depuis 1 semaine je n'ai plus de variation de couleur et je ne comprends pas. L'info renvoyée dans les logs de domoticz est:
2018-09-06 22:05:00.158 Status: EventSystem: Fetching url http://1xx.xxx.x.xx:xxxx/json.htm?type=command¶m=setcolbrightnessvalue&idx=215&hue=45525&brightness=128&iswhite=false...
2018-09-06 22:05:00.158 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_hue.lua
2018-09-06 22:05:00.382 Status: setcolbrightnessvalue: ID: d7, bri: 100, color: '{m: 3, RGB: ff0000, CWWW: 0000, CT: 0}'
La valeur hue varie bien, la valeur brightness aussi mais la valeur setcolbrightnessvalue est toujours la mème :
ID: d7, bri: 100, color: '{m: 3, RGB: ff0000, CWWW: 0000, CT: 0}
mon script ci dessous
Code : Tout sélectionner
-- script_time_variation_hue.lua
t1 = os.date("*t")
print(t1) -- Initialise le seed
math.randomseed(os.time())
huename = "Lampe ambiance"
commandArray = {}
minutesnow = t1.min + t1.hour * 60
-- test for t1 > sunset
if (minutesnow > timeofday['SunsetInMinutes']) then
if (t1.min%5 == 0 and (otherdevices['Playstation 4 Etat'] == 'On' or otherdevices['Freebox player Etat'] == 'On')) then
local brightness = math.random(128, 255)
iswhite = "false"
local hue = math.random(1, 65535)
idx = otherdevices_idx[huename] -- name lamp
url = 'http://192.168.1.37:8085/json.htm?type=command¶m=setcolbrightnessvalue&idx=' .. idx .. '&hue=' .. hue .. '&brightness=' .. brightness ..'&iswhite=' .. iswhite
commandArray['OpenURL']= url
elseif (otherdevices['Playstation 4 Etat'] == 'On' or otherdevices['Freebox player Etat'] == 'On') then
commandArray['le salon'] = 'Off'
commandArray['Lampe ambiance'] = 'On'
end
end
if (otherdevices['Television Etat'] == 'Off') then
commandArray['Lampe ambiance'] = 'Off'
end
if (otherdevices['HTPC Etat'] == 'On' and otherdevices['Kodi Salon'] == 'Paused') then
commandArray['Lampe ambiance'] = 'Off'
end
if (otherdevices['HTPC Etat'] == 'On') then
commandArray['Lampe ambiance'] = 'Off'
end
return commandArray
Avez vous une idée?
Avez vous