I’m looking for an automation that is basically the opposite of this one so that it notifies when an entity comes online? Can anyone help? So I’d get a notification on the below when something goes offline then another one when it comes back online?
- id: 'eb88ef61-f976-4600-a20f-13d569aacba1'
alias: Sensor Offline
trigger:
- platform: event
event_type: state_changed
condition:
- condition: template
value_template: >
{{
trigger.event.data.entity_id.startswith('sensor.') and
trigger.event.data.new_state is not none and
trigger.event.data.new_state.state == 'unavailable' and
(
trigger.event.data.old_state is none or
trigger.event.data.old_state.state != 'unavailable'
)
}}
mode: parallel
action:
- wait_template: "{{ not is_state(trigger.event.data.entity_id, 'unavailable') }}"
timeout: "00:10"
continue_on_timeout: true
- condition: template
value_template: "{{ is_state(trigger.event.data.entity_id, 'unavailable') }}"
- data_template:
message: '{{ trigger.event.data.new_state.name }} is offline, please investigate'
title: Sensor Offline
service: notify.mobile_app_matts_iphone