Node Red seems to not check the state of a media player

Hey all!

I have a problem with one of my flows. It checks for a Z-Wave button press, which works. Then it sorts it into which button was pressed and if it was pressed once, twice or held. This also works. After that it checks if my Chromecast audio is playing, but it just seems to skip over that. In Home Assistant it does show the correct state, but Node Red just doesn’t seem to get it.

How do I check what is going wrong here? My flow looks like this, don’t know if that helps anything:

https://gyazo.com/5ec949f4a90730514d3ad4b1547a46f7

I think the problem there is the getstate node. It needs payload.entity_id from input, no matter if you enter the field.

So maybe after switch and the output that goes to get state add after a template that you can send the entity_id as payload.entity_id or change node. I have stumbled into this and this is so far my solution, in my automations.

The getstate works normally by using the field in the node if you use inject. I have no idea why this behavior, but it would be great if the input was overrided by setting it in the field instead of obeying the input.

I can’t reach my setup right now to check what it is called exactly but I just deleted the entity ID from the message and let the check state node assign one. Now it is working great, so it is sort of your solution but another way ahaha. Thanks for the help anyway! :slight_smile: