Hello everyone,
I’m currently working on a Home Assistant automation and I’ve run into a bit of a roadblock. I’m trying to set up an automation where a notification is sent only to the user who triggered the event. Here’s the code I’m using:
alias: test
trigger:
- platform: state
entity_id:
- alarm_control_panel.test
from: disarmed
to: armed_away
condition: []
action:
- service_template: "notify.mobile_app_{{ trigger.to_state.context.user_id }}"
metadata: {}
data:
message: test
The problem is, I’m getting an error message that says “UndefinedError: ‘dict object’ has no attribute ‘to_state’”. I understand that this error typically indicates that I’m trying to access an attribute of the trigger object that doesn’t exist in the current context. However, I’m not sure how to resolve this issue.
Does anyone have any suggestions on how I can fix this issue? Any help would be greatly appreciated!
P.s. If there’s a way to do this natively in Alarmo, I’d like to do that instead.