-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A question about Energy Saving control #20
Comments
Hi @opep Today I took the time to figure this out as well. The closest I got was by just sending the buttons in the correct order. It isn't a perfect way, but for me it seems te work fine. See #22 for sending buttons. It all comes down to timing, so to prevent a callback hell I used async/await.
|
Great! I am looking forward to try your findings, but it seems that I have to learn something first. From where are you running this code? How will it know the TV IP? I would like to run it from a Raspberry Pi3 running Home Assistant automation software (http://home-assistant.io). Thanks for you valuable help. |
Wow, that is a fast reply after what(?) a half year. So some background of my 'not yet existing' setup. Currently I am running Openhab2 for my home automation, however, I am planning to migrate to Athom Homey which runs on NodeJS. JavaScript is my preferred language to work with so developing my own plugins won't be too difficult. However, before I will invest, I want to make sure I can do whatever I want and my LG tv is one of those requirements. I have looked at Home Assistant before, but it just didn't make the cut for me personally. So for the code-snippet, I just quickly set up an NodeJS 10 project and added LGTV2 as a dependency. I gave my TV a fixed IP address way back so I just had to look that up. You can find this in the network settings of your tv. I am not sure if Home Assistant can trigger a NodeJS script. The code-snippet is just a small part of the overall code. The test.js is a good start for setting up the connection and when lgtv receives the event 'connect' you can subscribe, request, or get the Websocket connection. I included a EnergySaving example project. Just ensure you have NPM and NodeJS (8+ at least I think 8 should be good) installed. Unzip it, run I hope it made things a bit clearer for you, if you need any help let me know and I'll try to find some time to help you out. |
Thank you very much for taking your time writing a more detailed explation. Yeah, it is a long time since I opened the thread, but we all live almost always connected nowadays rsrs. |
Also, in Node-Red there is a palette for integration with LG TVs. There is a node called "Request" (Sends arbitrary requests to the API). Since you like JavaScript, do you play with Node-Red? Can it be done that way? There is also nodes: Control and Button. |
I had progresses by the Node-red path. It seems that I will be able to do the same. Node-Red will be a good solution since it interfaces with Home Assistant. |
Got it to work using node-red. Certainly not the best way but it works. Missing the integration with HA which should not be difficult, but node-red can control the buttons and timing. I Should have tryed this path before. Thanks for your reply. |
Glad to hear you got things to work! Good luck with the HA integration. |
I have a question:
Would it be possible to control energy saving mode (Off, Low, Mid, High, Screen off) in a LG TV (SJ8000), running WebOS 3.7.0?
Thanks for your clarification.
The text was updated successfully, but these errors were encountered: