I have an automation I use to notify me when a door or window is opened. Recently after an update I am getting an error in the script. I am not sure what I need to change to fix the script.
service: notify.mobile_app_charles_iphone_xs
data:
title: Sensor Opened!
data:
priorty: high
ttl: 0
color: red
message: |
📵 {{ state_attr(trigger.to_state.entity_id, 'friendly_name') }} is Open!
There is a problem with the trigger.to_state.entity_id line.
When I run this I get the following error running action message
Error rendering data template: UndefinedError:‘trigger’ is undefined
Double check the entity ID of your iPhone and its related services… there have been a few comments here and other forums about them changing recently related to a recent iOS update.
Thanks for the help.
I think my issue was related to the ‘iphone’ ios update issue.
I went into HA app and renamed my phone from ‘iphone’ to its actual name.
Waited a few minutes and everything updated in HA.
Now my sensors are working and triggers are triggering.