node-red-contrib-lgtv
node-red-contrib-lgtv copied to clipboard
Subscribe to power states?
I can’t seem to be able to be notified when the TV is turned off. The homebridge webOS plugin seems to do that by poking at the port, but it would be nice to have an event made available to Node-Red.
The control
node should output the current connection state as boolean payload.
And will the node issue that when the connection is closed (I assume that will be when it goes on standby) even if I never issued a command?
yes, it should
Well, I’ve had to resort to polling the TV on port 3000 and generating my own event from when it goes away or comes back - the control output isn’t flexible enough, because I need to send out a command to the TV to get an updated result back...
My tv (C8) it will almost always return true. I get no message when I hit the power button on the remote :( Also, in this state I am able to wake it up by sending the POWER button through the button node. After a while the TV will go to deeper sleep where only the WOL packet will wake it up from.
Any way to detect these power states?
I confirm that the node sends only the "true" status, "false" does not receive. Please fix this so that both statuses work.
+1
Hello,
I also use contrib-lgtv and have the problem that after switching off the TV with the IR remote control and then switching the house to sleep, the device comes on again. This is done with the "turnOff" command in alternation ... on / off / on / off ... it works for a few minutes, then the TV falls into deep sleep. How can I do that? The status is only toggled using the "Request" function with the URL "ssap: // system / turnOff".
Thank you in advance!
hello again, I recognized the problem and was able to find a solution for myself. New TV's have a setting in the menu that allows the TV to be switched on via an app. In the original LG app, there is only one button called "Switch off TV". This button toggles the on / off state if the setting in the TV's menu allows it to be switched on via apps. The TV remains permanently accessible via ping, as soon as the setting has been switched off, the node or ping is disconnected after approx. 30 seconds.
Problem solved.
Bit of a late response, but for whomever is interested:
I noticed this issue too. Turns out, there TV broadcasts an empty appId
string when the TV is powered off. This package checks whether the appId
is defined, and if it's not, it does not broadcast anything further. This fixes it for me:
https://github.com/DiederikvandenB/node-red-contrib-lgtv/commit/67ef73de04d9f4cb74fd588cefeef338eb7b3bf8
You can use my package by running npm install DiederikvandenB/node-red-contrib-lgtv
, but be aware that I deleted a lot of nodes that I was never going to use anyway. If you do still need those, just fork this repo and apply the fix yourself.