I have a script that is switching off my Apple TV. When I run the script from the Home Assistant Script tab, it works as expected.
I have added this script in a Node-RED automation. However, when the script is kicked from this automation (even if I just ad an inject node directly before the automation node), it does an action that do not match the script. It worked at the beginning but stopped working for unknown reasons.
why do you need to run the HA script, instead of controlling the apple tv directly from NR. What the script does contain which cannot be implemented in NR?
This is kinda beyond an error. I’d expect the script to fail or execute. Changing the actual command and providing the right format to the apple tv is unlikely. The script executes normally from HA?
Thanks for all your comments. Indeed, I am currently leveraging a script, because the script was already set up before I got interested to NR. I am new to this, so this was not my priority yet to convert the script, but rather the automation.
The script is fairly basic: it checked the state of a device and if the device is on, it runs the command on the Apple TV remote:
- home_hold
- select
Now I have tested just the script node with an inject node, and it seems that the problem does not come from the script node itself. I am using switch nodes to listen to the action on a z-wave remote:
At face value the obvious mistake would be miss wiring the nodes. Maybe export the flow so we can look at the connections. Otherwise the call service node should show under it when it last fired.
Do you see that under the correct call service node with the script?