I just started using node red and thought i would tinker by converting my movie light automation to a node red flow. At a basic level it works great, play dims, pause/stop return to full brightness.
The issue i’m having is I only want this to occur if the media_content_type equals “movie”. I used get template node to get a boolen based on {{ states.media_player.xboxone.attributes.media_content_type == “movie” }}, if a movie is playing this outputs true anything else is false.
I can’t seem to figure out how to pass or halt the payload based on that template output.
In your current flow you would just drop in a switch node between the get template node and the call-service node and check for payload equals true. For your information is would be faster to use a current-state node the get the media_player.xboxone.attributes then using the get-template node.
My recommendation since you’re already using a trigger-state node is to add the check for it in there.
constraint comparator: failed entity "media_player.xboxone" property
"new_states.attributes.media_content_type" with value undefined failed "is" check against (str) movie