Dzvents:Comment lancer une Scène?
Publié : 10 févr. 2017, 10:27
Salut, je débute en domotique et je me lance avec Dzvents. J'ai commencé à rédiger un script d'alarme mais je bute sur une action de Scène. J'ai donc créé une scéne dans Domoticz qui active toutes mes caméras pendant 10min. Lorsque le Dummy Alarme (270) est activé et que le PIR est On, j'active "normalement" la scène et reçois une notification. Je n'ai pas d'erreur de script et l'action est bien lancée. Pourtant, la scène ne se lance pas. Pour info, j'ai essayé plusieurs commandes:
domoticz.setScene('All_Caméra', 'On')
domoticz.setScene('All_Caméra', 'group_On')
domoticz.setScene('All_Caméra', 'Scene_On')
domoticz.setScene('All_Caméra', 'Open')
Voila, si quelqu'un peut m'aider.
Au fait, j'utilise une scène pour pouvoir activer mes caméras pendant 10min, chose que je n'arrive pas à faire avec le script LUA qui ne me remet pas les switch à l'état off.
Mon script ci-dessous:
return {
active = true,
on = {
['timer'] = 'every minute'
},
execute = function(domoticz, Alarme_TOTALE)
if (domoticz.devices[145].state == 'On' and domoticz.devices[270].state == 'On') then
domoticz.setScene('All_Caméra', 'On')
-- domoticz.devices[187].switchOn()
-- domoticz.devices[187].close().after_min(1)
domoticz.notify('Alarme', 'Présence_Salon',
domoticz.PRIORITY_EMERGENCY)
elseif (domoticz.devices[255].state == 'On' and domoticz.devices[270].state == 'On') then
domoticz.setScene('All_Caméra', 'On')
domoticz.notify('Alarme', 'Présence_Garage',
domoticz.PRIORITY_EMERGENCY)
elseif (domoticz.devices[152].state == 'On' and domoticz.devices[270].state == 'On') then
domoticz.setScene('All_Caméra', 'On')
domoticz.notify('Alarme', 'Présence_Bureau',
domoticz.PRIORITY_EMERGENCY)
end
end
}
domoticz.setScene('All_Caméra', 'On')
domoticz.setScene('All_Caméra', 'group_On')
domoticz.setScene('All_Caméra', 'Scene_On')
domoticz.setScene('All_Caméra', 'Open')
Voila, si quelqu'un peut m'aider.
Au fait, j'utilise une scène pour pouvoir activer mes caméras pendant 10min, chose que je n'arrive pas à faire avec le script LUA qui ne me remet pas les switch à l'état off.
Mon script ci-dessous:
return {
active = true,
on = {
['timer'] = 'every minute'
},
execute = function(domoticz, Alarme_TOTALE)
if (domoticz.devices[145].state == 'On' and domoticz.devices[270].state == 'On') then
domoticz.setScene('All_Caméra', 'On')
-- domoticz.devices[187].switchOn()
-- domoticz.devices[187].close().after_min(1)
domoticz.notify('Alarme', 'Présence_Salon',
domoticz.PRIORITY_EMERGENCY)
elseif (domoticz.devices[255].state == 'On' and domoticz.devices[270].state == 'On') then
domoticz.setScene('All_Caméra', 'On')
domoticz.notify('Alarme', 'Présence_Garage',
domoticz.PRIORITY_EMERGENCY)
elseif (domoticz.devices[152].state == 'On' and domoticz.devices[270].state == 'On') then
domoticz.setScene('All_Caméra', 'On')
domoticz.notify('Alarme', 'Présence_Bureau',
domoticz.PRIORITY_EMERGENCY)
end
end
}