Hier ook domme lichten hoor, maar met de plc erbij slim.
Anyway
Automation is klaar en werkend.
Geluid alarm gaat af, berichten op smartphone, en alle lichten aan.
Zodra de sensor gerest is, gaat het bericht van de smartphone weg, en gaan de lichten automatisch uit
Code:
##########################
## Fire alarm
##########################
- id: 'fire_alarm_on'
alias: Brandmelding
mode: single
trigger:
- entity_id:
- binary_sensor.brand_living
- binary_sensor.brand_garage
- binary_sensor.brand_techniek
- binary_sensor.brand_wasplaats
- binary_sensor.brand_1ste
- binary_sensor.brand_2de
platform: state
from: "off"
to: "on"
for:
hours: 0
minutes: 0
seconds: 4
condition: []
action:
- service: notify.mobile_devices
data:
title: "Brand gedetecteerd!"
message: '{{ trigger.to_state.attributes.friendly_name }}'
data:
priority: high
ttl: 0
channel: brand_alarm
importance: high
persistent: true
sticky: true
tag: brand_alarm
- service: light.turn_on
data:
entity_id: all
- id: 'fire_alarm_off'
alias: Brandmelding opgelost
mode: single
trigger:
- entity_id:
- binary_sensor.brand_living
- binary_sensor.brand_garage
- binary_sensor.brand_techniek
- binary_sensor.brand_wasplaats
- binary_sensor.brand_1ste
- binary_sensor.brand_2de
platform: state
from: "on"
to: "off"
for:
hours: 0
minutes: 0
seconds: 8
condition: []
action:
- service: notify.mobile_devices
data:
message: Brand onder controle!
data:
priority: high
ttl: 0
channel: brand_alarm
importance: high
tag: brand_alarm # Tag is required for the persistent notification
- service: light.turn_off
data:
entity_id: all