a trigger can only be a state of “true” or “false”. it can’t be a string by itself.
you template is looking for a value of the “place” attribute of that sensor. Which is going to be the name of a place. So unless you have some strange place names they won’t be true or false.
you need to use a comparison to make the trigger become true.
Or use a different trigger.
if you want it to trigger on every change of the device tracker then use a state based trigger:
trigger:
- platform: state
entity_id: device_tracker.life360_kid1
attribute: place
to:
- platform: state
entity_id: device_tracker.life360_kid2
attribute: place
to:
- platform: state
entity_id: device_tracker.life360_kid3
attribute: place
to:
note I haven’t tried this so I’m not 100% sure you can use the attribute in an open ended “to:” test. I think it should work I think but I’m not 100% sure.
@rossk I normally debug these things extensively and can usually find the issue but when using trigger.entity_id type of codeit makes the process more difficult.
Even in developer tools when debugging automations / script with trigger.entity_id type of code is more difficult.
Anyways I have taken the suggestions and will test and report back for completeness.
Although it probably won’t matter in practice, for this automation, it’s probably better to use:
mode: parallel
Regarding testing, I agree with @rossk, you should try looking at the automation’s traces when it doesn’t work as expected. It gives a LOT of information that can help diagnose the problem.
If part of your testing uses the TEMPLATE tab, you can always manually define the trigger variable:
First, because it’s less to type (lol!), but second because if the entity doesn’t have a friendly_name attribute, the name state field will “fall back” to the entity ID, rather than causing an error. See State Objects.
Out of curiosity, what is the purpose of the wait_for_trigger step, since nothing comes after it?
Thx for the practical tip on using trigger.to_state.name
Probably not need but typically when implementing actionable notifications you have to wait for a trigger event from the user (action), example from one of my other automations:
I haven’t ever used “actionable notifications”, but I can’t see how a script would have to wait for it, unless you want the script to take some specific action based on it, and/or after it arrives.
Yes precisely, the automation would take some specific based on user selection. Imagine if no one is home and you are notified the garage is opened, you receive and actionable notification, say for OPEN_CAMS or CLOSE_DOOR, you select close door the automation would proceed to make a service call to cover.close with your garage entity_id or open your cameras for viewing.
Sorry, I generally know what they are and how and why they’re used. I was just saying I haven’t personally used them.
I was responding to your statements, “… typically when implementing actionable notifications you have to wait for a trigger event from the user (action) … In this case since I am not check the event (wait.trigger.event.data.action) maybe it can be omitted??”
I wasn’t sure what you meant by that. It almost seemed like you weren’t sure if something bad would happen if you didn’t have a wait in the script after a notify service call that had actions.