Setting the source of WebOS with Node Red

I want to create an automation in Node Red that sets the source of my WebOS based LG tv back to Live TV. I’m a bit lost how to do this however. Any help is appreciated.

I know how to read a source (made a sensor for that), but not how to set it.

Does this help?
(it is my flow to turn on my iTV app when nothing is selested)

[{"id":"c48c42a6.78523","type":"api-call-service","z":"5a62a7e4.2faa58","name":"Switch to KPN iTV","server":"37d68302.2aabcc","version":5,"debugenabled":false,"domain":"media_player","service":"select_source","areaId":[],"deviceId":[],"entityId":["media_player.living_room_tv"],"data":"{ \"source\" : \"KPN iTV\" }","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":950,"y":80,"wires":[["24ae85.8e3d617c"]]},{"id":"37d68302.2aabcc","type":"server","name":"Home Assistant","version":2,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

1 Like

Thanks! That’s simpler than I thought!

Unfortunatly since the last few HA updates the trigger (tv on) is quite slow for me. My idea was to set it back to live tv once the tv is turned back on, as the kids always leave it on netflix, etc. But the delay is quite heavy. I noticed this before (automation that turns Sonos music off if the tv is turned on). It’s not connected directly to my question, but curious. Do you also experience this?

Well, in my case i use a sensor using ping on the tv, which doesn’t trigger that much, and i build in some delay, as the tv requires some time before it responds to commands, so iow, yes :yum: