I’m hoping someone might be able to point out where I’m going wrong with a small automation I’m trying to do.
Basically, all I want is for a notification to be sent to my phone when a particular switch is turned from ‘off’ to ‘on’.
I have tested the ‘notify’ via the Services tool and it works fine (I can recieve the notification). However, when I add it to an automation, I don’t recieve anything. Here is my Automation Yaml
alias: Test Notification
description: 'Test'
trigger:
- platform: state
from: 'off'
to: 'on'
entity_id: switch.switch_3
action:
service: notify.mobile_app_dave_s_phone
data:
message: 'Test Success'
title: 'Test'
Everything seems ok when I check the config so am slightly confused as to what I’m missing.
For a little more information, the switch is actually a relay that is controlled via Tasmota. Essentially, its setup like a Sonnof basic. This powers my Boiler and so would like a notification everytime the boiler is turned on.
Does it show under Automations that this one is triggering? You don’t need to have the “from” you can just use to. Not sure if this is related but the indentation looks a little different:
- id: notify_garage_door_open
alias: "Notify Garage Door Opened"
trigger:
platform: state
entity_id: cover.garage_door_1, cover.garage_door_2
to: 'open'
action:
- service: notify.notify_angelo_devices
data_template:
title: "{{ trigger.from_state.attributes.friendly_name }} Opened"
message: "{{ trigger.from_state.attributes.friendly_name }} was opened"