Moi j'en suis là maintenant avec mes 3 switchs planqués
le script qui permet de voir si tous les accès sont fermés avant l'activation de l'alarme
Code : Tout sélectionner
commandArray = {}
if (devicechanged['Xiaomi Wireless Switch'] == 'Click'
or devicechanged['Xiaomi Wireless Switch etage'] == 'Click'
or devicechanged['Xiaomi Wireless Switch garage'] == 'Click')
and (otherdevices['Xiaomi Door Sensor porte entree'] == 'Closed'
and otherdevices['Xiaomi Door Sensor porte jardin'] == 'Closed'
and otherdevices['Xiaomi Door Sensor salle de bain'] == 'Closed'
and otherdevices['Xiaomi Door Sensor Cuisine'] == 'Closed'
and otherdevices['Xiaomi Door Sensor Salon'] == 'Closed') then
print('AlarmPanel Arm Away')
commandArray['Domoticz Security Panel'] = 'Arm Away'
commandArray['SendNotification']='Alerte #Alarme armee en absence!'
commandArray['Xiaomi Wireless Switch'] = 'Off'
commandArray['Xiaomi Wireless Switch etage'] = 'Off'
commandArray['Xiaomi Wireless Switch garage'] = 'Off'
elseif
(devicechanged['Xiaomi Wireless Switch'] == 'Click'
or devicechanged['Xiaomi Wireless Switch etage'] == 'Click'
or devicechanged['Xiaomi Wireless Switch garage'] == 'Click') then
commandArray['Xiaomi Wireless Switch'] = 'Off'
commandArray['Xiaomi Wireless Switch etage'] = 'Off'
commandArray['Xiaomi Wireless Switch garage'] = 'Off'
commandArray['SendNotification']='Alerte #Alarme non activée car une porte ou fenêtre est ouverte!'
end
return commandArray
le script qui permet d'éteindre l'alarme
Code : Tout sélectionner
commandArray = {}
if (devicechanged['Xiaomi Wireless Switch'] == 'Double Click'
or devicechanged['Xiaomi Wireless Switch etage'] == 'Double Click'
or devicechanged['Xiaomi Wireless Switch garage'] == 'Double Click') then
commandArray['Domoticz Security Panel'] = 'Disarm'
commandArray['SendNotification']='Alerte #Alarme desarmee!'
commandArray['Xiaomi Wireless Switch'] = 'Off'
commandArray['Xiaomi Wireless Switch etage'] = 'Off'
commandArray['Xiaomi Wireless Switch garage'] = 'Off'
commandArray['Xiaomi Gateway Alarm Ringtone'] = 'Off'
end
return commandArray
le script blocky pour être informé d'une intrusion en cas d'abscence
Comme l'alarme xiaomi sonne que quelques secondes j'ai opté pour ça pour la faire sonner plus longtemps :
dans une scene :
et une scene temporise en ARM away uniquement pour pouvoir rentrer chez soi

Celle ci n'est pas utilisée dans mon Arm Home
Reste à faire :
j'a aussi un petit raspberry pi qui gère les video et la musique sous la TV relié à un ampli, il faut que je trouve le moyen de reproduire wles action d'alimentation de l'appli Yatse qui fait du CEC : veille et CEC: Activation pour pouvoir allumer l'ampli si une porte ou une fenêtre s'ouvre en mon absence car l'alarme xiaomi seule ne me convient pas forcement.