Install dckiller

[TUTO] Alarme : Déclenchement de la sirène Gateway

Ici je vous présente mon Nœud Rouge pour déclencher la sirène de la Gateway Xiaomi. Vous pouvez sélectionner la sonnerie à jouer et le volume via un input_number et input_select.

J’utilise également un bouton switch Xiaomi pour désarmer l’alarme manuellement au cas où le mode présent a été trop lent à s’activer.

Le déclenchement de la sirène se fait si ma porte d’entrée ou celle du jardin est ouverte alors que l’alarme classique ou l’alarme nuit est activé.

Pour commencer vous devez créer un input_number id : input_number.gateway_volume
Valeur mini : 1
Valeur max : 100
Nom : Volume
Icon : mdi:volume-high

Ensuite il faut créer un input_select id : input_select.sirenes_gateway
Nom : Sirènes
Icon : mdi:alarm-bell
Options :
0 - Police car 1
1 - Police car 2
2 – Accident
3 – Countdown
4 – Ghost
5 - Sniper rifle
6 – Battle
7 - Air raid
8 – Bark
10 – Doorbell
11 - Knock at a door
12 – Amuse
13 - Alarm clock
20 – MiMix
21 – Enthusiastic
22 - GuitarClassic

Pour tester la sirène vous pouvez créer un input_boolean id : nput_boolean.sourdine_sirenes_gateway
Nom : Muet
Icon : mdi:volume-off

Sirene

[{"id":"98a682ec.2a8a9","type":"tab","label":"Alarme","disabled":false,"info":""},{"id":"7cbd3a9b.b751e4","type":"comment","z":"98a682ec.2a8a9","name":"[Alarme] Déclencher alarme","info":"","x":140,"y":20,"wires":[]},{"id":"b6be6aa5.948318","type":"server-state-changed","z":"98a682ec.2a8a9","name":"Porte d'entrée","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.detecteur_porte_entree","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":80,"y":80,"wires":[["9f79b88.df65848","b108e6ab.b2f2e8"],[]]},{"id":"9f79b88.df65848","type":"api-current-state","z":"98a682ec.2a8a9","name":"Alarme Activée","server":"a8c279c8.be8be8","version":1,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.alarme_maison","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":290,"y":80,"wires":[["d7084716.c5f1d8"],[]]},{"id":"ed4ef2a4.21695","type":"server-state-changed","z":"98a682ec.2a8a9","name":"Porte Buanderie","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.detecteur_porte_buanderie","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":90,"y":160,"wires":[["9f79b88.df65848","b108e6ab.b2f2e8"],[]]},{"id":"b108e6ab.b2f2e8","type":"api-current-state","z":"98a682ec.2a8a9","name":"Alarme Activée Nuit","server":"a8c279c8.be8be8","version":1,"outputs":2,"halt_if":"armed_night","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.alarme_maison","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":300,"y":160,"wires":[["d7084716.c5f1d8"],[]]},{"id":"d7084716.c5f1d8","type":"api-call-service","z":"98a682ec.2a8a9","name":"Alarme Trigger","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"alarm_control_panel","service":"alarm_trigger","entityId":"alarm_control_panel.alarme_maison","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":510,"y":120,"wires":[["2123b88f.253048"]]},{"id":"2123b88f.253048","type":"debug","z":"98a682ec.2a8a9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":120,"wires":[]},{"id":"1e29c5d0.e658da","type":"comment","z":"98a682ec.2a8a9","name":"[Alarme] Déclenchée","info":"","x":100,"y":220,"wires":[]},{"id":"3afc860c.b2cd1a","type":"server-state-changed","z":"98a682ec.2a8a9","name":"Alarme Déclenchée","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"alarm_control_panel.alarme_maison","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"triggered","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":110,"y":280,"wires":[["db67900e.4e981"],[]]},{"id":"ba66464c.36a2f8","type":"api-call-service","z":"98a682ec.2a8a9","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"message\":\"ALARME Intrusion à la maison!!!\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":300,"wires":[[]]},{"id":"81aeed3d.d3b0c","type":"api-call-service","z":"98a682ec.2a8a9","name":"Notication Siahm","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"message\":\"ALARME Intrusion à la maison!!!\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":360,"wires":[[]]},{"id":"db67900e.4e981","type":"delay","z":"98a682ec.2a8a9","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":280,"wires":[["594e4a7f.f88864"]]},{"id":"bd810276.b8fab","type":"change","z":"98a682ec.2a8a9","name":"Stop Boucle","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":420,"wires":[["594e4a7f.f88864"]]},{"id":"594e4a7f.f88864","type":"looptimer","z":"98a682ec.2a8a9","duration":"30","units":"Second","maxloops":"5","maxtimeout":"5","maxtimeoutunits":"Minute","name":"","x":500,"y":360,"wires":[["844073fa.c83cf","ba66464c.36a2f8","81aeed3d.d3b0c"],["2c1a92e1.93614e"]]},{"id":"844073fa.c83cf","type":"api-render-template","z":"98a682ec.2a8a9","name":"Sonnerie id + volume","server":"a8c279c8.be8be8","template":"{\n    \"data\": {\n        \"gw_mac\": \"78:11:dc:e1:b8:cb\",\n        \"ringtone_id\": \"{{ states.input_select.sirenes_gateway.state.split('-')[0] }}\",\n        \"ringtone_vol\": \"{{ states.input_number.gateway_volume.state|int }}\"\n    }\n}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":720,"y":420,"wires":[["d80572f9.02cbc"]]},{"id":"d80572f9.02cbc","type":"api-call-service","z":"98a682ec.2a8a9","name":"Jouer sirène","server":"a8c279c8.be8be8","version":1,"debugenabled":true,"service_domain":"xiaomi_aqara","service":"play_ringtone","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":930,"y":420,"wires":[[]]},{"id":"2c1a92e1.93614e","type":"api-call-service","z":"98a682ec.2a8a9","name":"Stop sirène","server":"a8c279c8.be8be8","version":1,"debugenabled":true,"service_domain":"xiaomi_aqara","service":"stop_ringtone","entityId":"","data":"{\"gw_mac\": \"78:11:dc:e1:b8:cb\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":930,"y":240,"wires":[[]]},{"id":"a0d5ce8f.0b461","type":"server-events","z":"98a682ec.2a8a9","name":"Bouton Clic Alarme","server":"a8c279c8.be8be8","event_type":"deconz_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":110,"y":560,"wires":[["4de23892.a8fc18"]]},{"id":"4de23892.a8fc18","type":"switch","z":"98a682ec.2a8a9","name":"","property":"payload.event.id","propertyType":"msg","rules":[{"t":"eq","v":"bouton_clic_alarme","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":290,"y":560,"wires":[["bfa740a5.61d92"]]},{"id":"bfa740a5.61d92","type":"delay","z":"98a682ec.2a8a9","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":440,"y":560,"wires":[["bd810276.b8fab","421895a6.72c2cc","bc0160ad.e08e8","47e4a045.b8a81"]]},{"id":"d40c438d.f4f42","type":"server-state-changed","z":"98a682ec.2a8a9","name":"Sonnerie On /Off","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.sourdine_sirenes_gateway","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":500,"y":280,"wires":[["844073fa.c83cf"],["2c1a92e1.93614e"]]},{"id":"421895a6.72c2cc","type":"api-call-service","z":"98a682ec.2a8a9","name":"Notication Aurélien","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_aurelien","entityId":"","data":"{\"message\":\"Alarme Désactivée Manuellement\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":500,"wires":[[]]},{"id":"bc0160ad.e08e8","type":"api-call-service","z":"98a682ec.2a8a9","name":"Notication Siahm","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_smartphone_siham","entityId":"","data":"{\"message\":\"Alarme Désactivée Manuellement\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":560,"wires":[[]]},{"id":"6eedd290.fca30c","type":"server-state-changed","z":"98a682ec.2a8a9","name":"Présent On","server":"a8c279c8.be8be8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.ha_mode_present","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":90,"y":420,"wires":[["bd810276.b8fab"],[]]},{"id":"47e4a045.b8a81","type":"api-call-service","z":"98a682ec.2a8a9","name":"Désactive Alarme","server":"a8c279c8.be8be8","version":1,"debugenabled":false,"service_domain":"alarm_control_panel","service":"alarm_disarm","entityId":"alarm_control_panel.alarme_maison","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":620,"wires":[[]]},{"id":"a8c279c8.be8be8","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
1 « J'aime »