Notification automation

This automation does not seem to work

It is supposed to send a telegram notification with the unavailable device’s name when it goes offline but it does not fire

alias: Device Unavailable
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.hallway_motion
    to: unavailable
  - platform: state
    entity_id: automation.office_motion_on
    to: unavailable
  - platform: state
    entity_id: binary_sensor.garage_door
    to: unavailable
  - platform: state
    entity_id: binary_sensor.lgarage_motion
    to: unavailable
condition: []
action:
  - service: telegram_bot.send_message
    data:
      Title: Sensor Offline
      message: "{{ trigger.to_state.name }} has been offline for 5 minutes!"
mode: single

I tried you config and I cant see any issues with the trigger. Try reloading automations from the sever configurations or do a system reboot. Even after the if the problem persists with trigein, you can try template type trigger than state.

 trigger:
  - platform: template
    value_template: '{{ states(''binary_sensor.hallway_motion'') == "unavailable"}}'
  - platform: template
    value_template: '{{ states(''binary_sensor.garage_door'') == "unavailable"}}'
  - platform: template
    value_template: '{{ states(''binary_sensor.lgarage_motion'') == "unavailable"}}'
  - platform: template
    value_template: '{{ states(''automation.office_motion_on'') == "unavailable"}}'

Also I am curious about why an automation(automation.office_motion_on) is one of the entities to check unavailability. Its an internal entity and it should be either on or off.

Good catch… I chose Automation rather than entity.
I’ll try rebooting to see if that helps. I need to remember to try that first

alias: Device Unavailable
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.hallway_motion
    to: unavailable
  - platform: state
    entity_id: binary_sensor.office_motion
    to: unavailable
  - platform: state
    entity_id: binary_sensor.garage_door
    to: unavailable
  - platform: state
    entity_id: binary_sensor.lgarage_motion
    to: unavailable
condition: []
action:
  - service: telegram_bot.send_message
    data:
      Title: Sensor Offline
      message: '{{ trigger.to_state.name }} has been offline for 5 minutes!'
mode: single

1 Like