Git Product home page Git Product logo

Comments (75)

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024 1

Sorry. Let me try to re-explain this now that I am now longer on mobile. When the TV is on (assuming it was turned on with its own remote and not Homekit), Homekit reflects that it is on. I can adjust volume, I can change the input with your newly updated release, and I can turn off the TV, all via Homekit. If I turn the TV off via Homekit, it will turn off. If I immediately afterwards turn it back on, it will turn on via homekit. However, if I let a few hours pass by, and attempt to turn it on again via Homekit, it will not turn on. Homekit always displays the correct status of the TV, whether it is off or not. What I am having trouble with is turning on the TV via homekit several hours after it was on. Mobile TV is enabled in the TV settings.

Here is my config file text.

  "accessory": "webos3",
  "name": "LG TV",
  "ip": "192.168.2.76",
  "mac": "48:8D:36:D7:60:42",
  "keyFile": "/home/pi/.homebridge/lgtv-",
  "pollingEnabled": true,
  "externalInput": true,
  "externalSource": "HDMI_1"

So in terms of static IP addresses, neither my router nor my TV are set to receive static IP addresses; however the way my router works is that it gives out "'static" IP addresses anyway (meaning everything is set to DHCP, but the router assigns the same IP to the same MAC address everytime).

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024 1

Yes it does. No idea what else to try.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

From my experience WiFi doesn't make a difference, it should work as good as Ethernet. Try to enable polling by setting the flag pollingEnabled to true in the config. This should improve state detection.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

It’s already enabled. The homebridge log shows “TV status off” every 5 seconds.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Then i will suspect that indeed your network connection could be the issue. When the TV is on and the TV status is off then something with your network is not correct. Maybe your TV ip address is not static?

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

When the TV is on the status is correct.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Huh? Bu you just said that the TV status is off...

Maybe you don't Mobile TV on enabled in the settings if you cannot turn it on.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

It sounds for me like a network issue or your mac address could be wrong. Maybe also something blocking the magic packets (firewall, antivirus)?
The tv is turned on by simply sending a magic packet in the network to the specified mac address.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

But why is it that I can sometimes turn on the TV via HomeKit, but other times I can’t? The MAC address is not wrong; just verified it. The IP address is always 2.76. If something was blocking packets why is it only for the ON (some of the time), and not the other actions?

from homebridge-webos-tv.

askovi avatar askovi commented on May 14, 2024

@thehauntedmattress If the switch and bridge become unresponsive after a few hours, something is idling on the machine where you're running homebridge. Make sure you don't have any settings enabled to power off any peripherals to save electricity, etc. Also check your firewall rules.
When you see it as unresponsive are you still getting pollings in the console?

Related to the suggestion above, you can also try reserving that local ip to the TV's mac address in your router config.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

I do still get pollings on the console. The console is always polling. Which firewall settings am I supposed to check? The firewall on the Pi 0W that I’m running Homebridge on, the router, or the TV? And what port numbers I am checking?

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Port 7/9 UDP are used for magic packets. Your issue is strange and i have never experienced that, maybe some other homebridge plugin is freezing your homebridge?

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

This is my list of Homebridge Plugins:

  • homebridge-webos3
  • homebridge-samsungsmarttv
  • homebridge-roomba690
  • homebridge-platform-wemo v1.3.6
  • homebridge-config-ui-x v2.5.1
  • homebridge-alexa

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Can't tell if any of those could the issue. You would need to test it out yourself, maybe also update homebridge?

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Does the issue still exists?

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

This has most probably nothing to do with the plugin, i would say that something is wrong with your setup.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

How recent is this newest update to the plug-in?

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

By the way in terms of this new update I am having a few more issues.

  1. I keep getting this message: webOS - error Error: EACCES: permission denied, open '/home/pi/.homebridge/lgtv-' for the key file (it requires me to hit yes for the permissions every time the Pi is rebooted).
  2. The app switching does not work. I have my app set to com.webos.app.netflix but it will not switch to netflix. The TV will however, exit Netflix if I turn off the switch.
  3. If I have the appSwitch configuration field enabled, then externalSourceSwitch does not show up as a Homekit button anymore.

Would adding multiple inputs and apps work as separate buttons or is it limited to one app and/or one input?

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Update: I have fixed issue 2 and 3. I currently just have issues with the key file. I am wondering if maybe because the key file is not being stored that maybe this is the reason why sometimes the TV does not turn on from the Home app? Thanks.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

This error usually comes when you don't have correct access rights to the specified directory. You would need to correct your permissions. Your user needs write permission in the specified directory.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Hey I actually fixed that error by moving that file to /var/homebridge. But I am still having the issue that started this thread.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

I think that issue is not related to the plugin but to your setup. Turning on the tv just sends a magic packet in the network, so either something is blocking this magic packet or it gets lost due to unstable network,

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

The problem is where and how would I even start troubleshooting that?

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Maybe find a tool to send Wake on LAN (Magic packets) and try if the tv wakes up constantly. This way you can narrow the issue down. If it wakes up constantly then probably there is something wrong with your homebridge or homebridge hardware.

from homebridge-webos-tv.

Patrick-Ber avatar Patrick-Ber commented on May 14, 2024

i have the same problem ... sometimes it work good .. sometimes it work not.
And Sometime , if i want power off, the plugin think the tv is on

Here a short copy of the status

Feb 23 22:01:17 hbridge2 homebridge[5135]: [2018-2-23 22:01:17] [Fernseher] webOS - TV state: On
Feb 23 22:01:18 hbridge2 homebridge[5135]: [2018-2-23 22:01:18] [Fernseher] webOS - TV state: On
-> Try to power off
Feb 23 22:01:19 hbridge2 homebridge[5135]: [2018-2-23 22:01:19] [Fernseher] webOS - disconnected from TV
Feb 23 22:01:19 hbridge2 homebridge[5135]: [2018-2-23 22:01:19] [Fernseher] webOS - TV state: On
Feb 23 22:01:20 hbridge2 homebridge[5135]: [2018-2-23 22:01:20] [Fernseher] webOS - TV state: On

and i think the tv is not off, only in a deep sleep ?

But sometimes i have no problems ...

and here is my config .

{
"accessory": "webos3",
"name": "Fernseher",
"ip": "MY IP ADRESS",
"mac": "MY MAC ADRESS",
"keyFile": "/home/pi/lgtvKeyFile",
"pollingEnabled": true,
"pollingInterval": 1,
"externalSourceSwitch": "HDMI_2",
"appSwitch": "netflix"
}

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

What I think is going on is the fact that the TV's turn off the network interface card when in standby after a certain period of time. This explains why if I shut off my TV and turn it on right away it works, but like after an hour it does not turn on if it already off. However, I do have "turn via wi-fi" enabled so I don't know why this is the case. I have the LG 49UJ6200 that I bought in December 2017, and I am curious if maybe this is something with newer TV's.

from homebridge-webos-tv.

Patrick-Ber avatar Patrick-Ber commented on May 14, 2024

hmm. i think somethink is wrong.
i turn my tv off with my remote control , but the status of homebridge say already ;

Feb 23 22:50:17 hbridge2 homebridge[5135]: [2018-2-23 22:50:17] [Fernseher] webOS - TV state: On.

and after a reboot of homebridge (TV is off) the same .
Feb 23 22:55:00 hbridge2 homebridge[1259]: [2018-2-23 22:55:00] [Fernseher] webOS - connected to TV
Feb 23 22:55:00 hbridge2 homebridge[1259]: [2018-2-23 22:55:00] [Fernseher] webOS - TV current appId:
Feb 23 22:55:00 hbridge2 homebridge[1259]: [2018-2-23 22:55:00] [Fernseher] webOS - TV current appId:
Feb 23 22:55:00 hbridge2 homebridge[1259]: [2018-2-23 22:55:00] [Fernseher] webOS - TV muted: No
Feb 23 22:55:01 hbridge2 homebridge[1259]: [2018-2-23 22:55:01] [Fernseher] webOS - TV state: On

Then 5 Minute after TV ist off.
I can turn it again on with homebridge.
But some error i see at log .

Feb 23 22:59:16 hbridge2 homebridge[1597]: [2018-2-23 22:59:16] [Fernseher] webOS - error Error: connect ECONNREFUSED 192.168.28.93:3000

but sometimes, it work without any problem ;
Turn TV OFF

Feb 23 23:03:06 hbridge2 homebridge[1597]: [2018-2-23 23:03:06] [Fernseher] webOS - TV state: On
Feb 23 23:03:07 hbridge2 homebridge[1597]: [2018-2-23 23:03:07] [Fernseher] webOS - disconnected from TV
Feb 23 23:03:07 hbridge2 homebridge[1597]: [2018-2-23 23:03:07] [Fernseher] webOS - TV state: Off

and TV is off ...

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

These are the messages from my logs that I get:

[2/23/2018, 5:19:10 PM] [LG TV] webOS - TV state: Off

And I get them every 5 seconds as I have polling enabled.

from homebridge-webos-tv.

Patrick-Ber avatar Patrick-Ber commented on May 14, 2024

i hope merdok can fix it ...

if longer time my tv is on , unreliable work the plugin.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Here's the thing. I don't think it's Merdok's issue or homebridge-webos3's issue. And I say that because while trying to diagnose this issue, I have downloaded another app that can send a magic packet to devices to wake them up called WakeMeOnLan. This app can only wake up that TV if it has been recently turned or off but not after a while (which is the exact issue that I have described from the beginning). So the issue is really with the TV itself and WebOS. What I need is a way to have the TV not turn off the network interlace card or wi-fi.
Now the way I have homebridge setup, is the Raspberry Pi 0W that is running it, it actually connected to that same TV via HDMI. I have already tried the HDMI-CEC Homebridge plugin and that didn't work either for some other reason. I have also tried going ethernet to the TV from the Pi itself (through a USB to ethernet adapter), and that didn't work either. I think both the ethernet port and the wi-fi are shutoff after certain amount of time of the TV being on standby.

from homebridge-webos-tv.

Patrick-Ber avatar Patrick-Ber commented on May 14, 2024

my problem is ... is the TV longtime ON ... this plugin work not correctly . If i try to turn of the TV with EVE App, i do not work. And if it turn off with remotecontroll the plugin say webOS - TV state: On though my TV is OFF.

But it´s only if the TV longer as 5 Minutes ON.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Like i suspect this is not an issue with the plugin but with some hardware. Most probably something with the TV itself.
@thehauntedmattress @Patrick-Ber Do you connect your TVs to LAN or WiFi? Maybe try a different connection? Do you both have the UJ TV series?

from homebridge-webos-tv.

Patrick-Ber avatar Patrick-Ber commented on May 14, 2024

i use only LAN (with a Gigabit switch). it is a oled xxb7d series. the lg remote app work without any problems.

from homebridge-webos-tv.

Yatr avatar Yatr commented on May 14, 2024

i have same as Patrick-Ber problem.
if i have "pollingEnabled": true, then webOS think that TV is "on" after i tuned it off.

[2018-2-24 11:26:00] [TV] webOS - TV current appId: com.webos.app.hdmi1
[2018-2-24 11:26:00] [TV] webOS - TV volume: 15
[2018-2-24 11:26:00] [TV] webOS - TV muted: No
[2018-2-24 11:26:03] [TV] webOS - TV state: On
[2018-2-24 11:26:08] [TV] webOS - TV state: On
[2018-2-24 11:26:13] [TV] webOS - TV state: On
[2018-2-24 11:26:18] [TV] webOS - TV state: On
[2018-2-24 11:26:23] [TV] webOS - TV state: On
[2018-2-24 11:26:28] [TV] webOS - TV state: On
[2018-2-24 11:26:31] [TV] webOS - TV state: On
[2018-2-24 11:26:31] [TV] webOS - disconnected from TV
[2018-2-24 11:26:33] [TV] webOS - TV state: On
[2018-2-24 11:26:38] [TV] webOS - TV state: On
[2018-2-24 11:26:43] [TV] webOS - TV state: On
[2018-2-24 11:26:48] [TV] webOS - TV state: On
[2018-2-24 11:26:53] [TV] webOS - TV state: On
[2018-2-24 11:26:58] [TV] webOS - TV state: On

If "pollingEnabled": false - webOS works fine, but homekit dont know if TV "ON" or "OFF".
My config:

 {
       "accessory": "webos3",
       "name": "TV",
       "ip": "XXXXX",
       "mac": "XX",
       "keyFile": "/home/pi/.homebridge/lgtvKeyFile",
       "pollingEnabled": true,
       "appSwitch": "megogo.hd"
    } 

TV - Oled65b6.

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

I am able to turn on TV every time if it was turned off less than hour ago. I noticed that my router shows my TV as disconnected (connection is WiFi). Even though I have poling Enabled it is not appearing in the console output:

Apr  2 14:28:25 raspberrypi homebridge[298]: [2018-4-2 14:28:25] [LG Ultra TV] webOS - current appId: com.webos.app.hdmi2
Apr  2 14:40:38 raspberrypi homebridge[298]: [2018-4-2 14:40:38] [LG Ultra TV] webOS - TV volume: 35
Apr  2 14:40:38 raspberrypi homebridge[298]: [2018-4-2 14:40:38] [LG Ultra TV] webOS - TV muted: No
Apr  2 14:40:44 raspberrypi homebridge[298]: [2018-4-2 14:40:44] [LG Ultra TV] webOS - disconnected from TV 
Apr  2 14:41:15 raspberrypi homebridge[298]: [2018-4-2 14:41:15] [LG Ultra TV] webOS - Error: Sec-WebSocket-Accept header from server didn't match expected value of WEiHbk7DEVutrhRP3k0UxG8uOqs=
Apr  2 14:41:17 raspberrypi homebridge[298]: [2018-4-2 14:41:17] [LG Ultra TV] webOS - connected to TV
Apr  2 14:41:17 raspberrypi homebridge[298]: [2018-4-2 14:41:17] [LG Ultra TV] webOS - current appId: com.webos.app.hdmi2
Apr  2 14:41:17 raspberrypi homebridge[298]: [2018-4-2 14:41:17] [LG Ultra TV] webOS - TV muted: No

My config:

{
    "accessory":"webos3",
    "name":"LG Ultra TV",
    "ip":"X.X.X.X",
    "mac":"X:X:X:X:X:X",
    "keyFile":"/var/homebridge/lgtvKeyFile",
    "pollingEnabled":true,
    "pollingInterval":5,
    "appSwitch":[
        "youtube.leanback.v4",
        "com.webos.app.hdmi2",
        "com.webos.app.hdmi1"
    ]
}

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

@sweetw0r I think the problem is because the TVs turn off the network interface cards after a specific time. I don't know how long it takes to do that since doing testing on that would be very impractical. I am trying to go through the HDMI-CEC route since the Pi running homebridge is connected to my LG TV using HDMI. The only issue I am having is the fact that my permissions won't allow CEC-Client to run when using systemd to start homebridge.

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

I did the testing. It takes about an hour for TV to stop network interface. Is there a way we can keep the connection on? Also it doesn’t explain why polling isn’t showing.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

It should not be an issue when the tv turns off the network interface. WOL (Wake On LAN) should still work as long as you have "Mobile TV On" enabled in your TV settings.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Does this plugin send a wake on lan command to turn the tv on?

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

Mobile TV is on. Should Wake On LAN work for WiFi as well?

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Mobile TV is on for me as well.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

@merdok Is there a way to send an SSH command in terminal that gets a polling state?

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

@thehauntedmattress While perusing the thread it seems like your "homebridgeDirectory" is "/var/homebridge". If so, then we have that in common. And from what I understood it is out of the ordinary. Maybe that is something to begin with?..

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

I really think its the TV and not the plugin. The plugin works flawlessly when the TV is on.

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

Found this https://www.depicus.com/wake-on-lan/wake-on-lan-for-apple-mac Let's see if it helps to test Magic packet out

It actually works:

~/Downloads/wolcmd [mac address] [ipaddress] 255.255.255.0 4343

Wake on Lan signal sent to MAC Address [mac address]
via Broadcast Address [mac's ipaddress] on port 4343
We should send 102 bytes we sent 102 bytes ... all done

Result: TV gets ON

Now I'll wait for couple hours to execute the command again. If it won't work then it's anything but plugging.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Is your tv connected via wi-fi or Ethernet?

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

The TV was offline:
screen shot 2018-04-03 at 10 43 35 pm

It got on after 2nd attempt!
I use WiFi only @thehauntedmattress

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

This morning (when 8 hours passed) I wasn’t able to switch the TV on neither via HomeKit nor via the wolcmd:(

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

@thehauntedmattress Yes, this plugin uses Wake On Lan, this is a standard to turning on devices over the network. Wake On Lan works for both WiFi and LAN.

@sweetw0r when you tried it with a wake on lan package and it still doesn't work then it is a tv issue. Which LG TV do you use? What WebOS version do you have?

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

@merdok Is there a way to send the wake on lan command through the pi's ethernet and not the WLAN if it doesn't do so already? I think the solution to my problem is connecting my pi via ethernet to my TV. If I can send a wake on lan command through ethernet, then it should work. I have already changed my mac address to the TV's MAC, but it still isn't turning on.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

The wake on lan command is sent to the whole network. If your RPi is connected to Ethernet and TV to WLAN then it should not make any difference.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

It still won't accept the magic packet even through ethernet after being off for a while. I proved this by sending an SSH wake on lan command. However I believe I have my solution that incorporates this plugin and CEC-Client.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

Then it seems that this must be an issue with newer TVs, i don't have any other explanation for that behavior...

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Yeah I guess you can this close this issue then.

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

I close it for now, but i will continue to investigate this.

@sweetw0r please let me know what TV you using.

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

@merdok it’s Model: 49UH6100

To summarize:
Something is causing the TV to stick around longe than hour and be registered as offline device for a router and yet still accessible for WOL to turn on. If longer then 2 hours it goes to deep sleep and can’t be woken up by WOL but by CEC HDMI and RC.

Can we send anything to it periodically to keep it awake?

from homebridge-webos-tv.

merdok avatar merdok commented on May 14, 2024

This most probably a issue with the TV. Maybe some settings like try to enable quick on.

from homebridge-webos-tv.

sweetw0r avatar sweetw0r commented on May 14, 2024

It was always on. Was trying to trigger it. No difference. Wonder why native LG app doesn’t have WOL feature. Maybe there is same reason behind this.

from homebridge-webos-tv.

mikebronner avatar mikebronner commented on May 14, 2024

I'm seeing this issue as well with 60UJ6300.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

If you can burn one of your HDMI inputs, and connect your Pi directly to the TV using one, I have a solution for you if you are interested.

from homebridge-webos-tv.

mikebronner avatar mikebronner commented on May 14, 2024

@thehauntedmattress thanks, but that wouldn't be an option for me. I seem to have found a solution that works (for me) at the moment: ommit the polling options from the config file alltogether. After removing "pollingEnabled": true, and "pollingInterval": 5, from the config.json file, I haven't had any more issues. I wonder if the TVs webOS is sensitive to frequent requests in order to avoid certain kinds of malware, and starts blocking IPs if they make too many requests within a given time?

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

I think for my situation the TV turns off the network card after being in standbye after an hour, so my solution involves HDMI CEC.

from homebridge-webos-tv.

lonksheep avatar lonksheep commented on May 14, 2024

@thehauntedmattress

Having exact issue you have had. LGTV Web OS3, and I’m pretty sure your diagnosis of the TV going into a network sleep after “X” hours is what is happening.

Can you describe how you solved it? I’m not a Homebridge ninja.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

The only solution that worked for me was to actually connect the Raspberry Pi running homebridge to the TV via HDMI. I then used a homebridge SSH command to turn on the TV using a homebridge CEC command.

from homebridge-webos-tv.

lonksheep avatar lonksheep commented on May 14, 2024

@thehauntedmattress

I have my Pi connected to TV....

If tomorrow I post up my config can you help me insert the relevant jsconfig info into mine?

I’ve managed to get my existing JSConfig working fine but every time I try and add other accessories/ platforms my code is always wrong :-( I’m quite the duffer!

I’ll install all the relevant packages from your link.

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

Yeah so here's what you need to install. I was actually mistaken about one of the plug-ins. The Homebridge CEC plug-ins never worked for me. This is why I am using an SSH command along with CEC Utils to do this. Here are the steps:

  1. Install CEC Utils
  2. Install Homebridge-SSH
  3. Below is the code for your config.json
 "accessories": [
          {
            "accessory": "SSH",
            "name": "name of accessory",
            "on": "echo on 0 | cec-client -s -d 1",
            "off": "echo 'standby 0' | cec-client RPI -s -d 1",
            "ssh": {
                "user": "piuser",
                "host": "pihostname",
                "port": 22,
                "password": "insertpassword"
            }
        }
    ]
  1. In the Home app on an iOS device, this will appear as a new switch. What I did is I combined the webOS on/off switch and this switch as one. When you press the new combined switch on, it should turn the TV on and off. It also even will know the state of on and off too.

All of this should work. I hope I am not missing any other steps. Good luck! Let me know if you have any more questions.

from homebridge-webos-tv.

lonksheep avatar lonksheep commented on May 14, 2024

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024
{
  "accessories" : [
    {
      "name" : "lgtv",
      "accessory" : "webostv",
      "appSwitch" : [
        "com.webos.app.tvguide",
        "youtube.leanback.v4",
        "com.webos.app.hdmi1",
        "com.webos.app.hdmi2",
        "com.webos.app.hdmi3",
        "com.webos.app.hdmi4"
      ],
      "mac" : "XX:XX:XX:XX:XX:XX",
      "keyFile" : "/home/pi/.homebridge/lgtvKeyFile",
      "pollingEnabled" : true,
      "ip" : "192.168.0.XX"
    },
         {
            "accessory": "SSH",
            "name": "name of accessory",
            "on": "echo on 0 | cec-client -s -d 1",
            "off": "echo 'standby 0' | cec-client RPI -s -d 1",
            "ssh": {
                "user": "piuser",
                "host": "pihostname",
                "port": 22,
                "password": "insertpassword"
            }
        }
  ],
  "bridge" : {
    "username" : "XX:XX:XX:XX:XX:XX",
    "name" : "Homebridge",
    "pin" : "032-45-154",
    "port" : 51826
  }
}

Just remember the commas and brackets are so essential or it will not work. But if this is your only config, this is a valid JSON. Use JSONLint to verify it works.

from homebridge-webos-tv.

lonksheep avatar lonksheep commented on May 14, 2024

from homebridge-webos-tv.

lonksheep avatar lonksheep commented on May 14, 2024

from homebridge-webos-tv.

lonksheep avatar lonksheep commented on May 14, 2024

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

So you are trying to turn on a PlayStation 4 that is connected to an LG TV?

from homebridge-webos-tv.

lonksheep avatar lonksheep commented on May 14, 2024

from homebridge-webos-tv.

thehauntedmattress avatar thehauntedmattress commented on May 14, 2024

So first off, when I am not using my PS4, I always power it down completely, and do not use rest mode. Second, my PS4 is connected to a Samsung smart TV. I am using a Samsung TV homebridge plug-in to achieve this. The Samsung plug-in, however, sends commands to the TV by emulating button presses from a would be remote control. This includes buttons for switching to an HDMI source (kind of like how this LG plug-in does it). However, if a PS4 is not on, it does not send a signal via HDMI. This means that if the Samsung TV does not detect a source from the HDMI, it will not switch to it. The way around this is so set up a series of button presses with a small delay between them. The TV will also check if it is on first, and if it is not, it will turn itself on. Afterwards it will fire the following button presses:

  1. Input
  2. Left (x6)
  3. Right (x1)
  4. Select

The reason why left needs to be pressed 6 times, is that I have 6 sources on my input. That way it goes all the way to the first one (no matter where it is on the list), and then my PS4 is my second source. It will then hit enter and select the HDMI source. Then HDMI CEC will turn on the PS4. So I know this is very complicated, but it does work.

Now it is theoretically possible for you to make it so that you turn on the TV and then switch to whatever HDMI source your PS4 is connected and use HDMI CEC to actually turn it on.

from homebridge-webos-tv.

slonoed avatar slonoed commented on May 14, 2024

For whoever has this issue: setting broadcastAdr field to target IP helps because packed gets to destination (if firewall is ok with it).

from homebridge-webos-tv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.