Code : Tout sélectionner
return { active = true, logging = { level = domoticz.LOG_DEBUG,marker = 'Mini_Inter_LED_Lidl'},on = { devices = { 'Mini_Inter', 'LED_Lidl',},}, -- {validation du script {le script écrit dans les LOG_DEBUG de DomoticZ , -- nom du script='Mini_Inter_LED_Lidl'} {liste des devices{nom des devices='Mini_Inter', 'LED_Lidl'}}
execute = function ( domoticz, item) domoticz.log ( "Mini_Inter : "..item.state) -- EXECUTER la fonction DomoticZ , -- VERIFIER l'état de Mini_Inter dans les logs DomoticZ
if item.state == 'simple_pression' then -- SI l'état de Mini_Inter passe a simple_pression ALORS
domoticz.log ( "simple_pression sur Mini_Inter > LED_Lidl = On") -- VALIDATION de simple_pression sur Mini_Inter dans les logs PASSE a la suite
domoticz.devices ( 'LED_Lidl').switchOn() -- ALLUMER device LED_Lidl
elseif item.state == 'double_pression' then -- SINON SI l'état de Mini_Inter passe a double_pression ALORS
domoticz.log ( "double_pression sur Mini_Inter > LED_Lidl =") -- VALIDATION de double_pression sur Mini_Inter dans les logs PASSE a la suite
domoticz.devices ( 'LED_Lidl') -- REGLER device LED_Lidl (a définir)
elseif item.state == 'longue_pression' then -- SINON SI l'état de Mini_Inter passe a longue_pression ALORS
domoticz.log ( "longue_pression sur Mini_Inter > LED_Lidl = Off") -- VALIDATION de longue_pression sur Mini_Inter dans les logs PASSE a la suite
domoticz.devices ( 'LED_Lidl').switchOff() -- ETEINDRE device LED_Lidl
end end} -- FIN de la fonction , -- FIN du script