Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Cycling through sensors

$
0
0

@ZSasha wrote:

Hello,

could some help me please with my task?
I have a number of (door/window) sensors that could be in “on” or “off” state.
I need to cycle through them to get a name of a sensor which is in “on” state to fire a message to a user.
Currently I have this setup:

# Called before alarm goes to ARM state to make sure all doors are shut.
- alias: Doors pre-check
  trigger:
    platform: state
    entity_id: input_boolean.alarm_arm_state
    to: 'on'
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: binary_sensor.door_window_sensor_158d0002b6d532 #Rear Sliding Door
        state: 'on'
      - condition: state
        entity_id: binary_sensor.door_window_sensor_158d0002b7d039 #Living Sliding Door
        state: 'on'
...
  action:
    - service: tts.google_say
      entity_id: media_player.googlehome8032
      data:
        message: "Attention! Some doors still open!"

Is it possible, instead of one message “Attention, some doors opened” create individual messages so I would get something like “Attention, kitchen door is open”, “Attention, garage door is opened” etc?

Each sensor has its own meaningful description of course.

Thank you.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles