Hi!
How can I get the name of an entity, while using multiple entities in scripts?
I have created an script to make a snapshot from 2 (or more) cameras. This is my action snipet:
But this create only a single file, called snapshot_.jpg.
I have tried {{entity_id.name}}, but no success at all, no images are created and got an error about entity_id is not a valid value.
NOTE: I’m editing this script as YAML file, using Web GUI. After inserting double-quotes and save script, no errors are displayed…but after going back do script list, then opening this script for editing, the quotes are done!
what am I doing wrong here?
Basicly, I’m trying to make a script that take a snapshot of two cameras and send notification (with pictures) to my android phone (running companion app). I know that I must send two notifications.
I can make a static script, but I would like to use the feature that enable to select multiple target devices/entities…what I don’t know is how to identify each item in script (or in automation). How can I get the entity ID when multiple targets are selected?
Note1: I’ll create an automation that will call this script if some conditions are met, but first I need to make this script to work. Also, this script will be possible called by more than one automation in the future.
TBH, I have no idea. I only ever call the camera snaphot service for one camera entity and create the filename based on what triggered it from the automation.
But I do know that the {{entity_id}} part is expecting a variable called “entity_id” to be declared somewhere before it is used in that template.
The snapshot service docs are little lacking on explaining that field descriptor.
I never use the UI to write automations so I have no idea what that might mean.