AlexanderBabel / homebridge-broadlink-rm

[This fork supports TV accessories] Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
46 stars 11 forks source link

TV Ping not working #31

Closed sushenmathur closed 4 years ago

sushenmathur commented 4 years ago

Ping with tv type not working, here is my json code

"name": "TV", "type": "tv", "pingIPAddress": "192.168.0.39", "pingFrequency": 20, "pingIPAddressStateOnly": true, "host": "192.168.0.4", "allowResend": true, "data": { "on": "260050000001269511141114111411141114111411131213113911391139113911391114113812381114111411391139113911141114111312381139111411141114113911391139110005450001264b11000d050000000000000000", "off": "260050000001269511141114111411141114111411131213113911391139113911391114113812381114111411391139113911141114111312381139111411141114113911391139110005450001264b11000d050000000000000000", "volume": { "up": "260058000001289313121312131213121213121213121312133713371337133713371312133712371337133713121337131213121337131213121312133712131237133713121336140005440001284a13000c560001284913000d05", "down": "260050000001289413121213121213121312131213121312133713371337133712371312133713371337133713371337121213121337131213121312131213121337133712131237130005440001264b13000d050000000000000000"

here is the log output Screen Shot 2019-09-16 at 8 44 24 pm

Can successfully ping the device Screen Shot 2019-09-16 at 8 44 50 pm

S474N commented 4 years ago

What is "allowResend"?

sushenmathur commented 4 years ago

when using Siri it sends the command irrespective if device state.

S474N commented 4 years ago

But I cannot find this value in documentation/sample files.

1rado1 commented 4 years ago

@sushenmathur do you have panasonic viera TV?

sushenmathur commented 4 years ago

@sushenmathur do you have panasonic viera TV?

No

kiwi-cam commented 4 years ago

Hi @sushenmathur I haven't been able to replicate your issue. I personally use pingIPAddress on my TV and it works fine. I do notice something is odd with your network. That ping output you've provided shows 3 ping packets being sent, and 6 response packets being received - 1 had two duplicates and 3 had one duplicate.

Is there anything unusual with your network?

sushenmathur commented 4 years ago

Hi @kiwi-cam i've tried again and still same result, not sure why there was duplicate ping responses then but it seems ok now. The only thing I am doing is I have multiple RM devices

{ "name": "Bedroom TV", "type": "tv", "host": "192.168.0.6", "pingIPAddress": "192.168.0.3", "pingFrequency": 5, "pingIPAddressStateOnly": true, "allowResend": true, "data": { "on": "260050000001269511141114111411141114111411131213113911391139113911391114113812381114111411391139113911141114111312381139111411141114113911391139110005450001264b11000d050000000000000000", "off": "260050000001269511141114111411141114111411131213113911391139113911391114113812381114111411391139113911141114111312381139111411141114113911391139110005450001264b11000d050000000000000000", "volume": { "up": "260058000001289313121312131213121213121213121312133713371337133713371312133712371337133713121337131213121337131213121312133712131237133713121336140005440001284a13000c560001284913000d05", "down": "260050000001289413121213121213121312131213121312133713371337133712371312133713371337133713371337121213121337131213121312131213121337133712131237130005440001264b13000d050000000000000000" } image

image

kiwi-cam commented 4 years ago

Interesting... your config looks the same as mine except the use of two devices. And I can't see how a device would change the ping behaviour.

I've created a branch with more logging around the ping. Could you try installing using this: npm install -g git+https://github.com/AlexanderBabel/homebridge-broadlink-rm#kiwi-cam-pingtest You should be able to run this and just install over the top.

Then restart homebridge and share your logs. You should see something like this:

Oct 04 08:32:47 homebridge[16822]: [PINGDEBUG] Sending ping to Chromecast.fritz.box
Oct 04 08:32:48 homebridge[16822]: [PINGDEBUG] Sending ping to 192.168.21.54
....
Oct 04 08:33:04 homebridge[16822]: [PINGDEBUG] Found ping status of active: true
Oct 04 08:33:04 homebridge[16822]: [PINGDEBUG] Found ping status of active: true
Oct 04 08:33:09 homebridge[16822]: [PINGDEBUG] Found ping status of active: true
Oct 04 08:33:09 homebridge[16822]: [PINGDEBUG] Found ping status of active: true
Oct 04 08:33:14 homebridge[16822]: [PINGDEBUG] Found ping status of active: true
Oct 04 08:33:14 homebridge[16822]: [PINGDEBUG] Found ping status of active: true
sushenmathur commented 4 years ago

@kiwi-cam Cam, appreciate the help I've installed as you said. Do i need to update my config.json because the log files still looks the same, cant see the PINGDEBUG like your log file image

kiwi-cam commented 4 years ago

That's interesting. I'd guess either, it's not running the version you think it is (installed to a different path), or it's not recognising the pingIPAddress configuration line and not pinging anything.

Could you run npm list -g --depth=0 and share the output? You should see a line like:

── homebridge-broadlink-rm-tv@4.0.1 (git+https://github.com/AlexanderBabel/homebridge-broadlink-rm.git#....

Also, maybe try clearing the pingIPAddress line of your config.json and retype it in case there are hidden characters there from copy+pasting it?

sushenmathur commented 4 years ago

@kiwi-cam

image

kiwi-cam commented 4 years ago

I haven't given up yet... but I'm running out of ideas.

You wouldn't happen to have "isUnitTest" : true in your configuration would you? This could disable the pinging.

I've added more debug information to the TV accessory to confirm the configuration is loading. Could you try running:

npm install -g git+https://github.com/AlexanderBabel/homebridge-broadlink-rm#kiwi-cam-pingtest

and restart Homebridge again? This should add more to the logs e.g.:

Oct 04 13:11:13 homebridge[2459]: [PINGDEBUG] Found pingIPAddress of Chromecast.fritz.box
Oct 04 13:11:13 homebridge[2459]: [PINGDEBUG] Starting ping monitoring...
Oct 04 13:11:13 homebridge[2459]: [PINGDEBUG] Sending ping to Chromecast.fritz.box
Oct 04 13:11:13 homebridge[2459]: [PINGDEBUG] Found pingIPAddress of 192.168.21.54
Oct 04 13:11:13 homebridge[2459]: [PINGDEBUG] Starting ping monitoring...
Oct 04 13:11:13 homebridge[2459]: [PINGDEBUG] Sending ping to 192.168.21.54
....
Oct 04 13:11:20 homebridge[2459]: [PINGDEBUG] Found ping status of active: true
Oct 04 13:11:24 homebridge[2459]: [PINGDEBUG] Found ping status of active: false
Oct 04 13:11:26 homebridge[2459]: [PINGDEBUG] Found ping status of active: true
Oct 04 13:11:28 homebridge[2459]: [PINGDEBUG] Found ping status of active: false
Oct 04 13:11:30 homebridge[2459]: [PINGDEBUG] Found ping status of active: true
sushenmathur commented 4 years ago

@kiwi-cam Cam I really appreciate you helping out no i don't have isUnitTest in the config I've attached my config file if it helps troubleshooting config.txt

I'll try again after installing the new debug branch

kiwi-cam commented 4 years ago

No problem @sushenmathur

I see two things in the config you've attached:

  1. The pingIPAddress fields are missing and
  2. There's a rogue comma on the third to last line

I assume you've had the pingIPAddress fields in the spots you've indicated earlier.

sushenmathur commented 4 years ago

Sorry wrong file, here is the updated one config.txt

kiwi-cam commented 4 years ago

Ah, interesting approach. You've defined two platforms, with a device each. Personally, I would've defined a single platform with two devices. Like this: https://pastebin.com/7xc2e1n6

That said, other than that rogue comma on the third to last line again, I can't see anything wrong with it.

sushenmathur commented 4 years ago

@kiwi-cam I've done as you said and put all accessories under same platform, still getting the same issue. I tried to put ping for a switch instead a tv type, it still the same

image

I guess i'll try to reinstall the plugin.. thanks for all your help

kiwi-cam commented 4 years ago

If you're still having the issue after reinstall please let us know.