merdok / homebridge-webos-tv Goto Github PK
View Code? Open in Web Editor NEWHomebridge plugin for LG webOS TVs
License: MIT License
Homebridge plugin for LG webOS TVs
License: MIT License
Hey,
cheers for very useful plugin! I just have an issue with turning on the tv. it doesnt work...
[12/30/2016, 1:33:21 AM] Loaded plugin: homebridge-webos3
[12/30/2016, 1:33:22 AM] Registering accessory 'homebridge-webos3.webos3'
[12/30/2016, 1:33:22 AM] ---
[12/30/2016, 1:33:22 AM] Loaded config.json with 1 accessories and 0 platforms.
[12/30/2016, 1:33:22 AM] ---
[12/30/2016, 1:33:22 AM] Loading 1 accessories...
[12/30/2016, 1:33:22 AM] [My webOS tv] Initializing webos3 accessory...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
┌────────────┐
│ 031-45-154 │
└────────────┘
[12/30/2016, 1:33:22 AM] Homebridge is running on port 51826.
[12/30/2016, 1:33:22 AM] [My webOS tv] webOS3 connecting to TV
[12/30/2016, 1:33:23 AM] [My webOS tv] webOS3 prompt for confirmation
[12/30/2016, 1:33:31 AM] [My webOS tv] webOS3 connected to TV
(node:7155) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
[12/30/2016, 1:36:23 AM] [My webOS tv] webOS3 TV state: On
[12/30/2016, 1:36:23 AM] [My webOS tv] webOS3 TV volume: 100
[12/30/2016, 1:36:24 AM] [My webOS tv] webOS3 TV muted: No
[12/30/2016, 1:37:21 AM] [My webOS tv] webOS3 disconnected from TV
[12/30/2016, 1:37:32 AM] [My webOS tv] webOS3 connecting to TV
[12/30/2016, 1:37:37 AM] [My webOS tv] webOS3 connecting to TV
[12/30/2016, 1:37:42 AM] [My webOS tv] webOS3 connecting to TV
When the TV is off and then you issue a command to turn it on, the device is unresponsive for about 30 seconds. During this time, the Home app would display "not responding" and if you use Siri she would go "some of your devices are not responding". I thought this was strange because the TV would turn on fine, so I checked the logs:
[2/11/2018, 9:35:33 AM] [LG TV] webOS3 TV state: Off
[2/11/2018, 9:35:34 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:36 AM] [LG TV] webOS3 error Error: connect EHOSTUNREACH 192.168.1.160:3000
[2/11/2018, 9:35:37 AM] [LG TV] webOS3 TV state: Off
[2/11/2018, 9:35:39 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:39 AM] [LG TV] webOS3 error Error: connect ECONNREFUSED 192.168.1.160:3000
[2/11/2018, 9:35:39 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:42 AM] [LG TV] webOS3 TV state: Off
[2/11/2018, 9:35:42 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:42 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:44 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:45 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:45 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:47 AM] [LG TV] webOS3 TV state: Off
[2/11/2018, 9:35:47 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:48 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:48 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:50 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:51 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:51 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:52 AM] [LG TV] webOS3 TV state: Off
[2/11/2018, 9:35:53 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:54 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:54 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:56 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:57 AM] [LG TV] webOS3 TV state: Off
[2/11/2018, 9:35:57 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:57 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:35:59 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:36:00 AM] [LG TV] webOS3 connecting to TV
[2/11/2018, 9:36:00 AM] [LG TV] webOS3 connected to TV
[2/11/2018, 9:36:02 AM] [LG TV] webOS3 TV state: On
[2/11/2018, 9:36:07 AM] [LG TV] webOS3 TV state: On
Looks like during the turn on period the TV refuses connection for 30 seconds. I wonder if there's any way to fix this?
Any chance we could add an option for opening apps on the TV? Plex, Netflix, Custom app etc?
I've set "pollingEnabled" to false, but in log I've "webOS - connecting to TV" every second
Not a huge deal, but it seems when turning the TV on through the Home app, the TV will properly turn on immediately, but the state will remain off and unresponsive for several minutes.
Below is a log, starting from when I turn the TV on.
[11/9/2017, 6:57:53 PM] [LGTV] webOS3 connecting to TV
[11/9/2017, 6:57:56 PM] [LGTV] webOS3 TV state: Off
[11/9/2017, 6:58:09 PM] [LGTV] webOS3 connected to TV
[11/9/2017, 6:59:40 PM] [LGTV] webOS3 TV volume: 100
[11/9/2017, 6:59:40 PM] [LGTV] webOS3 TV muted: No
[11/9/2017, 6:59:40 PM] [LGTV] webOS3 TV state: On
Upon toggling the TV state on Home, it connects, receives the state (off), and turns it on. There is then a 90 second delay before it receives the new state (on). During this time, the accessory is non-responding in the home app.
Hi, it's possible set more then 1 externals HDMI for easier switching between HDMI's? Thanks
I saw the previews issue I would suggest doing something like this below on line 110. Seems like all of this are related to the tv being of. I could create a pr if you let me know which option you prefer.
this.lgtv.on('error', (error) => {
if( ! error.contains( 'EHOSTDOWN' ) && ! error.contains( 'ETIMEDOUT' ) && ! error.contains( 'EHOSTDOWN' ) ){
this.log.error('webOS - %s', error);
}
});
or
this.lgtv.on('error', (error) => {
if( string.indexOf( 'EHOSTDOWN' ) === -1 && string.indexOf( 'ETIMEDOUT' ) === -1 && string.indexOf( 'ECONNREFUSED' ) === -1 ){
this.log.error('webOS - %s', error);
}
});
Hi.
Would be great if the plugin allows us to generate buttons to send pre-defined messages to the TV.
So if I'm watching the TV and someone opens the door, I can be informed directly in the TV.
I don't know if this is possible or not, but could be a good option (I saw it for Home Assistant but not for Homebridge).
Many thanks in advance.
Not sure how long it takes, but somewhere a bit over a week, the accessory stops working. It still shows as responding in the Home interface, but when trying to turn the TV on or off, it fails.
Restarting Homebridge temporarily fixes the issue. Soft workaround is making a cronjob to restart homebridge once a week.
I'll try and get logs next time it happens.
I am getting these message on a regular basis
[2018-4-30 10:57:12] [LGwebOSTV] webOS - Error: socket hang up
[2018-4-30 10:57:12] [LGwebOSTV] webOS - Error: connect EHOSTUNREACH 192.168.1.199:3000
I can turn the TV on remotely using Homekit and when off it is in standby. After some time, between 12 and 24 hours Homebridge crashes. Unfortunately I suffer from the missing log issue so I have no more detail. Could the crash be related to this error?
Hi, I don't think this is a bug per say related to this project but curious if anyone is observing very long delays before the LG TV websocket is available for connection?
I have done many tests without using this framework to characterize timing and this is roughly what I found out, issuing *nix commands from my old rpi (which will run homebridge). Ive also done the equivalent using the core LGTV2 project that this homebridge extension uses, and it connects roughly after that long delay.
LG TV: OLED65E7/801.11ac connection, rpi/Enet
Thanks for an insight/info !
Like mentioned in #50:
If you turn off the OLED tv it does not get offline (layer 3 still available, therefore script still connected) right away from time to time. One should be able to turn on and off the TV at all times.
My guess is, currently untested, that we are safe to remove the connected check for turning on the TV. WoL is Layer 2 based - it does not depend on a disconnected/connected state to the API. Even when you turn on the TV while it is turned on it should not change anything.
/usr/local/lib/node_modules/homebridge/lib/api.js:108
if (name.indexOf('.') == -1) {
^
TypeError: Cannot read property 'indexOf' of undefined
at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:108:12)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:314:45)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:85:36)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
No issue; just wanted to show some appreciation for this lovely plugin I use every day 💛
Hello,
I have a LG 58UH635v TV under webos3.
I would like to test your module on my homebridge but I do not know how to do ... I confess that I do not master the installations with github ...
Can you help me please?
I would be pleased to give you feedback.
thank you.
This plug in is very nice, thank you for working on it.
Wanted to know if you have your TV connected with Wireless or cabled with ethernet?
I have mine just connected with Wifi, the TV will turn on but it will not respond that it turned on or not.
Doesn't look like more than 1 appSwitch can be setup - would be really great to have buttons in the Home app (as well as using Siri) to switch between apps. Is this possible to add at some point?
I want to use appSwitch to create three separate switches (for HDMI 3, AV 1, and Live TV) so I'm declaring this in my config
"appSwitch": [
"com.webos.app.hdmi3",
"com.webos.app.livetv",
"com.webos.app.externalinput.av1"
]
Should that work? I only see a single switch in Home app, displaying all three items comma separated. Pressing the switch changes the input once, but does not cycle through.
Hi,
I'm running my server on a Mac, so the pi directory in the config doesn't exist. Is it possible to make that log file location adjustable so for other platforms?
Thanks,
Eric
On my LG TV remote, there is a button on the top right that says "STB PWR" which powers on my set-top box. Is there any way to implement this into the plugin? 🙂
When setting the Volume to 0, the Mute icon appears and stays on the screen. This is fine behavior for when toggling the Volume lamp, but I now still have to use the webOS Remote app to set volume to 0 without the icon. (Done by holding Volume Down until 0)
So maybe you can make it so that when HomeKit requests a Volume of 0, you actually send these two commands:
Thanks for the plugin. However, I have an issue saving the permission token. In the log, it said error: ENOENT: no such file or directory , open ‘/home/pi/Homebridge/lgtvKeyFile’.
I have set the raspberry pi permission right (don’t know set it right or wrong), still can’t store permission token. Can any one help? Thanks.
I just bought a new C8 OLED to replace my by B6 OLED that used to work great with this plugin. The tv works also with in exception I can’t turn the tv on with Siri or Home app. Once I turn on with the remote it works fine
If I use Siri with HomePod to turn on the TV the response seems too slow for Siri to recognize. It says, that "some devices are not responding". After a few more seconds the "turning wheel" in HomeKit is gone and the Switch shows that the TV is turned on.
Maybe the check for the availability of port 3000 is too slow?
{ "accessory": "webostv", "name": "LG-TV", "ip": "<ip>", "mac": "<mac>, "keyFile": "./lgtvKeyFile", "pollingEnabled": true, "volumeControl": false, "channelControl": false }
Hi there - this is not really an issue with this project but I am curious why you need to represent volume and mute via bulbs. Is this because of a limitation of HomeKit?
I'd rather just have the Volume as a lightbulb, rather than 2 volume switches. Is it possible to turn it off in the config?
Thanks for the fantastic plugin.
Sometimes the toggle says my TV it's on when it's not. Can this be fixed?
Hi i have a problem to use these plugin with two LG TV at moment i have configured both but when i use the power button or the volume control in some case the action go to another television configured.
For example power off the TV on kitchen but will go down the TV on the dinner room.
I think there is the owerwrite of configuration during the process on homebridge.
My configuration.
{
"accessory": "webos3",
"name": "TV Salone",
"ip": "192.168.1.105",
"mac": "3C:CD:93:78:B7:ED",
"keyFile": "/home/pi/.homebridge/lgtvKeyFile",
"pollingEnabled": true
},
{
"accessory": "webos3",
"name": "TV Cucina",
"ip": "192.168.1.106",
"mac": "3C:CD:93:9F:D6:7B",
"keyFile": "/home/pi/.homebridge/tvcucina/lgtvKeyFile",
"pollingEnabled": true
}
There is some action to do to handle these situation?
Thanks.
I've tried to make the plugin working with multiple TV at the same time but it seems it only works with the first TV acessed by homebridge/plugin. I created diferent "keyfile" directories for each TV as config.json bellow :
{
"bridge":{
"name":"Homebridge",
"username":"CD:22:3D:E3:CE:30",
"port":51826,
"pin":"031-45-154"
},
"description":"Homebridge",
"accessories":[
{
"accessory": "webos3",
"name": "TV 1",
"ip": "192.168.1.205",
"mac": "c8:08:e9:97:68:B9",
"keyfile": "/home/pi/.homebridge/1/lgtvKeyFile",
"pollingEnabled": true,
"appSwitch":[
"com.webos.app.livetv",
"netflix",
"youtube.leanback.v4"
]
},
{
"accessory": "webos3",
"name": "TV 2",
"ip": "192.168.1.206",
"mac": "e0:51:63:74:82:76",
"keyfile": "/home/pi/.homebridge/2/lgtvKeyFile",
"pollingEnabled": true,
"appSwitch":[
"com.webos.app.livetv",
"netflix",
"youtube.leanback.v4"
]
},
{
"accessory": "webos3",
"name": "TV 3",
"ip": "192.168.1.207",
"mac": "5c:dc:96:2f:00:2c",
"keyfile": "/home/pi/.homebridge/3/lgtvKeyFile",
"pollingEnabled": true,
"appSwitch":[
"youtube.leanback.v4",
"com.webos.app.livetv"
]
}
]
}
Is it possible to add more than one application to the accessory?
For example "spotify" and "netflix"?
When not... what would happen when i add a second accessories called webos3 to the config.json with another app?
thanks in advance
For some reason setting a volumeLimit doesn’t limit the volume limit. I still can go beyond the set volume limit with the Home controls.
Hello,
I really love the add-on, thanks for great work.
However, after the latest update Home app shows the wrong status for the TV. When I click the switch it can turn the tv off, change switch to off position after 5 seconds switch goes on again while tv stays of. Here is the config
{ "accessory": "webos3", "name": "LG Television", "ip": "192.168.1.24", "mac": "ab:ab:ab:ab:ab:ab", "keyFile": "/home/pi/.homebridge/lgtvKeyFile", "pollingEnabled": true, "volumeControl": false, "pollingInterval": 10, "appSwitch": [ "com.webos.app.hdmi4" ] }
And here is the log:
[4/4/2018, 9:46:40 PM] [LG Television] webOS - connected to TV [4/4/2018, 9:46:58 PM] [LG Television] webOS - disconnected from TV [4/4/2018, 9:49:04 PM] [LG Television] webOS - connected to TV [4/4/2018, 9:49:04 PM] [LG Television] webOS - current appId: com.webos.app.hdmi4 **[4/4/2018, 9:49:08 PM] [LG Television] webOS - disconnected from TV** [4/4/2018, 9:49:24 PM] [LG Television] webOS - connected to TV
The bold part is the where I turn tv off, and in the logs it says "connected to TV" but tv is off actually. I'm pretty sure that Mac address is correct and ip is binded to it.
Thanks
I have your plugin working with a webOS 3 LG TV. If I manually turn on the TV using the actual remote, I can turn it off and then immediately turn it back on within a few minutes using Homekit. But if I let a few hours go by, attempting to turn on the TV using Homekit says that it is unresponsive. Any way to fix this issue? Thanks.
Edit: The TV is connected through Wi-fi and not ethernet, if that makes a difference.
Whenever I try to run homebridge I get this error (homebridge still runs fine though with my other devices responding):
webOS - error Error: getaddrinfo ENOTFOUND undefined undefined:3000
Config:
"accessories": [{
"accessory": "webos3",
"name": "My TV",
"ipaddress": "XXX",
"mac": "XXX",
"keyFile": "/home/pi/.homebridge/lgtvKeyFile",
"pollingEnabled": false,
"externalInput": true,
"externalSourceSwitch": "HDMI_3",
"appSwitch": "com.webos.app.tvguide"
}],
In homebridge I see this:
[My TV] webOS - connecting to TV
What can I do to fix it?
Does HomeKit support Volume yet? It certainly has a speaker now.
Potentially how about using a dimmer switch, or make that an option?
You could use a dimmer switch to move between the inputs as well. e.g. 10% is one input, 20% another, etc etc.
Lastly, any chance we could have the option of just calling power "TV", or whatever we want? Closest I can get is "TV Power"
Thanks v much.
In the Apple Home app (and Eve) I'm seeing the "Accessory Not Supported" message.
Here's what my config looks like:
{
"accessory": "webos3",
"name": "My webOS tv",
"ip": "",
"mac": "",
"pollingEnabled": true,
}
Any ideas why this is occurring? Latest Homebridge and iOS.
Thanks in advance!
Hi! Love your plugin.
Just a question... every time I reboot my raspberry homebridge server, my LG TV asks permission about a remote app and I have to accept it every time to use it on homebridge.
Is there a way to bypass that request on reboot?
When will you implement channel changing? That would be great!!!
Thank you
Hi Just did the update and now getting the following error;
webOS - Error: connect ETIMEDOUT 192.168.1.23:3000
Hello,
When I activated my switch on homekit, the TV turn ON
but I've a "No response" error
when I check the logs:
[2018-2-1 23:33:35] [OLEDtv] webOS3 TV state: Off
So off course I can only turn it ON ... (I'm not using the volume options as I've a SONOS speaker there...)
any idea what I setup wrong?
Just curious, is anyone else seeing this issue specifically when using this plugin? I have polling enabled and the interval set to 5.
Steps:
Me: "Hey Siri, turn on the TV"
Siri: "Sending request…"
< TV turns on >
Siri: "Some of your devices are not responding."
Same when turning off the TV.
Maybe have it set as a parameter inside the accessory (ie: volume: true or something).
I have an optical soundbar, so the volume can't be controlled anyway. It just causes some issues by occasionally sending the mute command to the TV when I turn off everything.
I am newer to all of this. I am comfortable successfully making changes to the coding. The problem I am trying to work through is changing the inputs you have loaded. I only have one external input (hdmi ARC) my receiver handles all other switching. I would like to be able to app switch to Netflix instead of hdmi2 and revert back to the ARC hdmi port, instead of the coaxial input, when Netflix is turned off. I would like the same control when YouTube is selected. YouTube button is currently working, just reverts to the channel input when turned off. Netflix, I cannot figure out how to add functionality to get to this app. Thanks for your help.
i, thanks for the plugin,
But i always got this error message http://imgur.com/a/lstIi , randomly
Hi first of all great plugin and thank you for all your hard work. I was wondering if there is anyway to enhance the plugin In order to change HDMI?
Hi guys,
Can't find the "Mobile TV" setting on my TV. Is my tv not supported? I have the 49UB850V.
I keep getting the following message:
[13/02/2018, 10:15:46 pm] [LG TV] webOS3 connecting to TV
[13/02/2018, 10:15:46 pm] [LG TV] webOS3 error Error: connect EHOSTDOWN 192.168.0.17:3000 - Local (192.168.0.3:62144)
[13/02/2018, 10:15:47 pm] [LG TV] webOS3 connecting to TV
[13/02/2018, 10:15:49 pm] [LG TV] webOS3 connecting to TV
[13/02/2018, 10:15:53 pm] [LG TV] webOS3 TV state: Off
[13/02/2018, 10:15:53 pm] [LG TV] webOS3 TV state: Off
and then it'll be ok for a short while, and then not OK.
I've tried connecting the home bridge host (A Mac mini) to Ethernet and using Wireless. Same effect.
Network runs DHCP, but the TV has its address assigned to it, so it will always get the same IP address.
Hi,
Since upgrading the plugin from webos3 I've discovered that when polling is true. The TV Power always stays on after briefly turning off. Thus, Siri cannot turn the tv back on
Hey! I've noticed an issue for a while, but its been getting a bit worse lately. When homebridge starts and connects to the TV it frequently turns the TV on when it was previously off. This can be especially surprising at night since the TV is quite bright.
Also seems to happen when the connection is lost (host not found or timeout etc), and later reconnects.
Any recommendations for how I can troubleshoot this? Not necessarily an issue with the plugin itself, but I haven't been able to sort it out yet.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.