Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- antifurto_sirene_off:
- alias: Spegne le sirene
- description: Spegne le sirene dell'antifurto come configurato o invia persistent in modalità TEST
- sequence:
- - service: script.turn_off
- target:
- entity_id: script.antifurto_sirene_on
- - if: "{{ is_state('input_boolean.alarm_test_mode', 'off') }}"
- then:
- - parallel:
- - if: "{{ is_state('input_boolean.alarm_sirena_interna', 'on') }}"
- then:
- - alias: "Spengo sirena interna"
- service: mqtt.publish
- data:
- topic: 'zigbee2mqtt/Sirena interna/set'
- payload: '{"warning": {"duration": 1, "mode": "stop", "level": "very_high", "strobe": false}}'
- - if: "{{ is_state('input_boolean.alarm_sirena_esterna', 'on') }}"
- then:
- - service: script.antifurto_sirena_esterna_off
- else:
- - service: script.multinotify
- data:
- title: "Spegnimento sirena [TEST]"
- message: "Le sirene sarebbero state spente"
- notify_ha: true
- antifurto_sirene_on:
- alias: Accende le sirene
- description: Accende le sirene con le modalità stabilite dalla legge o invia persistent in modalità TEST
- sequence:
- - if: "{{ is_state('input_boolean.alarm_test_mode', 'off') }}"
- then:
- - parallel:
- - if: "{{ is_state('input_boolean.alarm_sirena_interna', 'on') }}"
- then:
- - alias: "Accendo sirena interna"
- service: mqtt.publish
- data:
- topic: 'zigbee2mqtt/Sirena interna/set'
- payload: '{"warning": {"duration": 180, "mode": "burglar", "level": "very_high", "strobe": true}}'
- - if: "{{ is_state('input_boolean.alarm_sirena_esterna', 'on') }}"
- then:
- - service: script.turn_on
- target:
- entity_id: script.antifurto_sirena_esterna_loop
- else:
- - service: script.multinotify
- data:
- title: "Accensione sirena [TEST]"
- message: "Le sirene sarebbero state accese per 3 minuti in totale"
- notify_ha: true
- antifurto_sirena_esterna_loop:
- alias: Loop sirena esterna
- description: Loop on/off sirena esterna a norma di legge. Attivare o disattivare in modo asincrono
- sequence:
- - if: "{{ is_state('input_boolean.alarm_sirena_esterna', 'on') }}"
- then:
- - repeat:
- count: 6
- sequence:
- - service: siren.turn_on
- target:
- entity_id: siren.cam_tetto_siren
- - delay: 30
- - service: siren.turn_off
- target:
- entity_id: siren.cam_tetto_siren
- - delay: 15
- antifurto_sirena_esterna_off:
- alias: Spegne le sirene esterne
- description: Spegne le sirene esterne
- sequence:
- - service: script.turn_off
- target:
- entity_id: script.antifurto_sirena_esterna_loop
- - alias: "Spegne la sirena della telecamera Tetto"
- service: siren.turn_off
- target:
- entity_id: siren.cam_tetto_siren
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement