Script PIR avec déclenchement multiple
Publié : 25 avr. 2019, 12:53
Bonjour ,
j'ai un script PIR qui déclenche un éclairage en H nuit et un Carillon en H Jour.
Le pb est que le PIR se déclenche plusieurs fois de suite . J'ai essayè temps capteur est sur une 1 s et 10 s .
Idem
Log :
2019-04-25 12:48:47.731 (RFXTRX433) Lighting 4 (radar0)
2019-04-25 12:48:47.737 (RFXTRX433) Chime (carillon)
2019-04-25 12:48:47.798 (RFXTRX433) Chime (carillon)
2019-04-25 12:48:47.955 (RFXTRX433) Lighting 4 (radar0)
2019-04-25 12:48:47.964 (RFXTRX433) Chime (carillon)
2019-04-25 12:48:47.061 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.061 Status: LUA: Ding - dong
2019-04-25 12:48:47.062 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.097 Status: LUA: Device based event fired on 'carillon', value 'On'
2019-04-25 12:48:47.174 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.174 Status: LUA: Ding - dong
2019-04-25 12:48:47.177 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.182 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.182 Status: LUA: Ding - dong
2019-04-25 12:48:47.182 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.206 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.206 Status: LUA: Ding - dong
2019-04-25 12:48:47.207 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.224 Status: LUA: Device based event fired on 'carillon', value 'On'
2019-04-25 12:48:47.302 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.302 Status: LUA: Ding - dong
Merci pour votre aide
j'ai un script PIR qui déclenche un éclairage en H nuit et un Carillon en H Jour.
Le pb est que le PIR se déclenche plusieurs fois de suite . J'ai essayè temps capteur est sur une 1 s et 10 s .
Idem
Code : Tout sélectionner
-- loop through all the changed devices
for deviceName,deviceValue in pairs(devicechanged) do
print ("Device based event fired on '"..deviceName.."', value '"..tostring(deviceValue).."'");
-- Script radar0
if devicechanged['radar0'] then
if deviceValue == "On" and (timeofday['Nighttime'])
then
commandArray['Eclairage_Ext'] = "On"
commandArray['inter_chalet_Virtuel'] = "On"
print("Device is On")
end
if deviceValue == "On" and (timeofday['Daytime'])
then
commandArray['carillon'] = "On"
print("Ding - dong ")
end
end
2019-04-25 12:48:47.731 (RFXTRX433) Lighting 4 (radar0)
2019-04-25 12:48:47.737 (RFXTRX433) Chime (carillon)
2019-04-25 12:48:47.798 (RFXTRX433) Chime (carillon)
2019-04-25 12:48:47.955 (RFXTRX433) Lighting 4 (radar0)
2019-04-25 12:48:47.964 (RFXTRX433) Chime (carillon)
2019-04-25 12:48:47.061 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.061 Status: LUA: Ding - dong
2019-04-25 12:48:47.062 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.097 Status: LUA: Device based event fired on 'carillon', value 'On'
2019-04-25 12:48:47.174 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.174 Status: LUA: Ding - dong
2019-04-25 12:48:47.177 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.182 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.182 Status: LUA: Ding - dong
2019-04-25 12:48:47.182 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.206 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.206 Status: LUA: Ding - dong
2019-04-25 12:48:47.207 Status: EventSystem: Script event triggered: mes_scripts
2019-04-25 12:48:47.224 Status: LUA: Device based event fired on 'carillon', value 'On'
2019-04-25 12:48:47.302 Status: LUA: Device based event fired on 'radar0', value 'On'
2019-04-25 12:48:47.302 Status: LUA: Ding - dong
Merci pour votre aide