I have two flood sensors and I am using two entity_ids for each sensor (alarm/ /burglar). The entity_ids friendly names are descriptive, so I do not need any more text in the notifications I send.
A generic automation for the two (ore more) sensor would be nice to accomplice.
One shortcoming is that you can only use one entity_id in a condition not several, or am I doing something wrong (this fails when executing while ok when Configuration validation)?
- conditions:
- condition: state
entity_id: sensor.fibaro_flood_sensor_burglar_loft,
sensor.fibaro_flood_sensor_burglar_kitchen
state: '3
when I only use one entity_id the automations work for this condition (WARNING), but also the default service (ALARM) notification is sent which it should not when burglar is triggered.
Any ideas?
- alias: "Flood sensor Alarm"
description: "Flood sensor Alarm - Flood/burglar (Kitchen/Loft)"
trigger:
- platform: state
entity_id:
- binary_sensor.fibaro_flood_sensor_loft
- sensor.fibaro_flood_sensor_burglar_loft
- binary_sensor.fibaro_flood_sensor_kitchen
- sensor.fibaro_flood_sensor_burglar_kitchen
action:
- choose:
- conditions:
- condition: state
entity_id: sensor.fibaro_flood_sensor_burglar_kitchen
state: '3'
sequence:
- service: notify.me
data:
title: 'HA - WARNING'
message: "{{ trigger.from_state.attributes.friendly_name }}"
default:
- service: notify.me
data:
title: 'HA - ALARM!'
message: "{{ trigger.from_state.attributes.friendly_name }}"
data:
push:
sound:
name: "Alarm_Haptic.caf"
critical: 1
volume: 1.0