I'm new to the Node RED world. This is a working sequence but it is just too long and hard to read and maintain. Since this sequence is just simulating button press, can I use one function node for this entire sequence?
Prossibly, but i suspect you are taking actions on each of these buttons so you might have to live with it (although it dowsnt have to be in one straight line - you could use link in/link out nodes and re-arrange it)
However, my question is - what on earth happens at the end of that flow?
It looks like your are operating dashboard buttons to get some kinda input somewhere?
Cant you just inspect the final value, capture that & send it directly?
Thanks for your advise. I think using LINK node would be helpful for nodes arrangement.
To answer your question, I am using an LG OLED TV so this sequence just turn off the screen. the TV is running on its webOS system but there is no interface to turn off the screen directly
I can use home assistant to control the TV but the functionality is limited https://github.com/bendavid/aiopylgtv/blob/master/aiopylgtv/endpoints.py. I believe the LGTV node would do something similar. It can communicate HTTP but i believe this setting is not exposed to the outside world. The remote control is using bluetooth (not so sure about it)? but it does not have a way to turn-off the screen with single button press.
The "screen off" option is hidden deeply inside the menu, Setting -> General Setting -> Picture -> Energy Saving -> Screen Off
One thing might worth to mention is that the audio control on the remote can actually turn off the screen by saying "turn of screen", however, i do not know how to capture this request.
you mean make them a sub sequence? sorry, I'm new to Node RED and do not know how to use one node as you described. I definitely want to use one node vs. a ton of them
You are using home assistant nodes and have configured each node to perform some action, correct ?
The information in the field names in the call-service node can be set via another node (inject, change, function, etc).
This is what I was alluding to with these comments...
but from a guess, the OP has to "drive the TV menu" to enter this "screen off" mode.
Perhaps undocumented, but the TV could well have an API call or IR command to do this in one hit.
My other suggestion would be - get a google mini or amazon alexa or the apple equivalent (I have 4 google minis all in a sync'd group piping pink floyd around my house as i speak/write)
I think the point @Steve-Mcl was making is that you make one button on the dashboard send a sequence of commands to the TV one after another. One button on the dashboard is not limited to causing a single action.
I thought the blue nodes were button presses sent to a TV, nothing to do with the dashboard?
If I understood this correctly, one way to achieve the 3 nodes suggested by @bakman2 would be to inject an array of messages through a split and then delay node to a single instance of the blue nodes responsible of sending then commands to Home Assistant.