I’ve found a few other posts about this that suggest I should use “{{ trigger.to_state.name }}”, but when I do this I get an error:
Error: Error rendering data template: UndefinedError: ‘dict object’ has no attribute ‘to_state’
My automation has 2 triggers, which are 2 different nest cameras triggering when they detect a person, full automation yaml posted below.
I’m sure I’m just doing something stupid, I’m new to HA. If there are useful reference docs on how to better discover this myself, I’d love that too (I’m poking around in the trace to see what properties exist under trigger, and none in there show the friendly name, just device_id … and I also haven’t found something that would let me go from device_id to friendly name?)
Depending on the chosen device, a Device Trigger can behave like a State Trigger or an Event Trigger. In this case, I believe it’s like an Event Trigger (so the trigger obect doesn’t have a to_state property).
An Event Trigger can report various things buf if you didn’t find what you want in the trace then it isn’t available.
ok thanks … I did see mention of using state triggers/actions instead of device triggers, and I tried that but couldn’t figure out how to get that to work with my nest camera … so I guess that is my next question
When I use the Automation UI to setup a state trigger (Entity → State) on my camera.front_door, I don’t see any attributes listed that would let me trigger when a person is detected?
The only entity in the drop-down related to my front door camera is “camera.front_door”, and if I pick that the only attributes are “model” or “brand”…
If this is not the full set of values available, is there somewhere to see the full set in HA? I found the DevTools → States page which does list those 2 attributes and a couple more, but still nothing that would seem related to person detection?