netzbus
(Netzbus)
April 24, 2022, 8:36pm
1
I want to send a notification if one of the smoke detecors state is “on”
But I have to match only for the state “on” not “off”
This is my not working condition
alias: Brandmelder
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.smoke_buero
- binary_sensor.smoke_paul
- binary_sensor.smoke_philipp
- binary_sensor.smoke_pool
- binary_sensor.smoke_sz
- binary_sensor.smoke_stiegenhaus
- binary_sensor.smoke_stueberl
- binary_sensor.smoke_wz
- binary_sensor.smoke_waschkueche
condition:
- condition: template
value_template: "{{ trigger.platform.state == 'on' }}"
action:
- service: notify.pushover
data:
message: Es brennt auf {{ trigger.from_state.attributes.friendly_name }}
title: ACHTUNG
mode: single
Any Idea how to match for the state “on” ?
calisro
(Rob)
April 24, 2022, 9:38pm
2
alias: Brandmelder
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.smoke_buero
- binary_sensor.smoke_paul
- binary_sensor.smoke_philipp
- binary_sensor.smoke_pool
- binary_sensor.smoke_sz
- binary_sensor.smoke_stiegenhaus
- binary_sensor.smoke_stueberl
- binary_sensor.smoke_wz
- binary_sensor.smoke_waschkueche
to: 'on'
from: 'off'
action:
- service: notify.pushover
data:
message: Es brennt auf {{ trigger.from_state.attributes.friendly_name }}
title: ACHTUNG
mode: single
or create a group of entities and trigger on that.
2 Likes
You just need to make a small adjustment to your condition template:
condition:
- condition: template
value_template: "{{ trigger.to_state.state == 'on' }}"
1 Like
calisro
(Rob)
April 25, 2022, 11:38am
4
That’s true but why keep it as a condition that will fire for any state change rather than trigger off the actual triggering criteria. THis would make the debugging module less effective as well. But yes you can do it via the condition.
1 Like