Not sure what you mean, but in case you don’t know, if a condition template evaluates to false the entire rest of the script is aborted, not just the next step. So, e.g., if input_boolean.johns_echo_playing_boolean is off, none of the media will play.
Ok, so how do I accomplish what I want to do? This is part of a Door Bell script, where I paused all the media players and then I wan’t to only set those to play that were playing before.
I have that stored in the 3 booleans. If on, they were playing before I ran the script and need to be turned back on.
I believe you can call the media_player.media_play service (like many services) with a list of entity_ids, where one of them doesn’t actually exist. So, you can use a data_template to “build up” the list of entity_ids to turn back on, something like this:
I find it interesting that Home Assistant does not log an error when a service is given a non-existent entity.
I would’ve expected the following code to fail the Config Check or report a run-time error concerning the non-existent entity. However, Home Assistant doesn’t care; it passes the check and no errors are reported (not even Warning or Info).
My takeaway is that you have to be careful when typing an entity’s name. If you misspell it in an automation or script, nothing in the system will report the non-existent entity.
Yeah, I’m not sure what the thinking was. Could it be on purpose, so that, say for example, you can write an automation or script that interacts with an entity that exists only sometimes but not all the time? (Like maybe a plug in Z-Wave device that you only use during the holidays.) Or is it just an accident of how the person who wrote that code chose to write it?
I based my suggestion above on how it currently works. There is at least one other way to do it that doesn’t depend on this “feature”, but it gets more involved.