MrAsterisco / homebridge-hisense-tv

A Homebridge plugin to control RemoteNow-compatible HiSense TVs.
MIT License
18 stars 8 forks source link

Incompatible models #25

Open JeremyLaurenson opened 2 years ago

JeremyLaurenson commented 2 years ago

Im seeing this error consistently in the HB logs:

An error occurred while fetching the current input: SyntaxError: Unexpected token b in JSON at position 0

MrAsterisco commented 2 years ago

Hi @JeremyLaurenson . Thanks for reporting this! Does the plugin work for you? Do you see the TV inputs in HomeKit?

jimmy0017 commented 2 years ago

I have the same issue. Keep showing " An error occurred while fetching the current input: SyntaxError: Unexpected token b in JSON at position 0" (Both on default ssl and custom ssl).

I saw TV inputs list once when I added the TV. But no more. I have Hisense U6G.

jimmy0017 commented 2 years ago

After killing the home app and reopens it, I can see the list of inputs. But I am not able to change it (aka, after I select HDMI1, it won't switch to HDMI1).

MrAsterisco commented 2 years ago

@jimmy0017 thanks for adding some context here, but unfortunately I don't have that TV to test it out. It'd be awesome, if you could run the Python script manually and see what the TV is returning when requesting the state.

Do you have command line access to your Homebridge instance?

jimmy0017 commented 2 years ago

Certainly. I should post it earlier.. Here are a couple different commands:

python3.8 hisensetv.py 192.168.20
.224 --get state --ifname ovs_eth4 -v                                                           
[2022-01-03 08:41:03,916] [INFO    ] Unverified SSL context created.                            
[2022-01-03 08:41:03,992] [DEBUG   ] subscribing to /remoteapp/mobile/F4:52:14:93:98:C0$normal/#
 and /remoteapp/mobile/broadcast/#                                                              
[2022-01-03 08:41:04,009] [DEBUG   ] Recieved message on topic /remoteapp/mobile/broadcast/ui_se
rvice/state with payload: {'endtime': 0, 'starttime': 0, 'statetype': 'livetv'}                 
{                                                                                               
    "endtime": 0,                                                                               
    "starttime": 0,                                                                             
    "statetype": "livetv"                                                                       
}          
python3.8 hisensetv.py 192.168.20
.224 --get state --ifname ovs_eth4 -v                                                           
[2022-01-03 08:41:26,397] [INFO    ] Unverified SSL context created.                            
[2022-01-03 08:41:26,473] [DEBUG   ] subscribing to /remoteapp/mobile/F4:52:14:93:98:C0$normal/#
 and /remoteapp/mobile/broadcast/#                                                              
b''           

I think the issue might be because I am on the Android TV side instead of in any particular HDMI. See two code block above.

I also tried to key sources. Nothing changes. See code below.

/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin # python3.8 hisensetv.py 192.168.20
.224 --key source_5 --ifname ovs_eth4 -v                                                        
[2022-01-03 08:43:10,195] [INFO    ] Unverified SSL context created.                            
[2022-01-03 08:43:10,271] [DEBUG   ] subscribing to /remoteapp/mobile/F4:52:14:93:98:C0$normal/#
 and /remoteapp/mobile/broadcast/#                                                              
[2022-01-03 08:43:10,275] [INFO    ] sending keypress: source_5                                 
/homebridge/node_modules/homebridge-hisense-tv-remotenow/bin # python3.8 hisensetv.py 192.168.20
.224 --key source_3 --ifname ovs_eth4 -v                                                        
[2022-01-03 08:43:14,930] [INFO    ] Unverified SSL context created.                            
[2022-01-03 08:43:15,005] [DEBUG   ] subscribing to /remoteapp/mobile/F4:52:14:93:98:C0$normal/#
 and /remoteapp/mobile/broadcast/#                                                              
[2022-01-03 08:43:15,010] [INFO    ] sending keypress: source_3

Let me know if you want me to test out any additional scripts. Thank you!!!

MrAsterisco commented 2 years ago

@jimmy0017 It looks like this TV isn't compatible with the script, as it's not responding to the state command.

Are you familiar with the MQTT protocol? Would you be able to sniff the packages using a MQTT client (like this one)?

johnnygoodface commented 2 years ago

Got the same issue with U7G, and the "Tile" in the Home app is always back to the "on" state after about 10 sec, even with the TV off. IMG_7599

MrAsterisco commented 2 years ago

@johnnygoodface thanks for reporting this!

For now, I'll add yours to the list of incompatible models.

When you have some time, it'd be awesome if you could use the MQTT client I posted above to sniff the traffic between the RemoteNOW app and your TV, so that we can see if there's a way to detect that the TV is turned off.

As I already explained, this plugin uses a "silent ping" to detect if the TV is turned on. If the TV responds to the ping, the plugin considers it turned on. Apparently, some models always respond to this ping, even when they're turned off.

johnnygoodface commented 2 years ago

FYI my TV is never actually Off, but “sleeping” only (on standby). This might explain the issue I’ll see what I can do to report the traffic with your utility. Cheers

Jean (envoyé de mon iPhone )

On Jun 20, 2022, at 2:23 AM, Alessio Moiso @.***> wrote:

 @johnnygoodface thanks for reporting this!

For now, I'll add yours to the list of incompatible models.

When you have some time, it'd be awesome if you could use the MQTT client I posted above to sniff the traffic between the RemoteNOW app and your TV, so that we can see if there's a way to detect that the TV is turned off.

As I already explained, this plugin uses a "silent ping" to detect if the TV is turned on. If the TV responds to the ping, the plugin considers it turned on. Apparently, some models always respond to this ping, even when they're turned off.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

kris0616 commented 2 years ago

any one know of issues the hisense 50a7g model? i can see the model in homebridge and home kit, no control or no inputs showing.

homebridge log shows, consistently. An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join') [14/07/2022, 10:39:54 am] [homebridge-hisense-tv-remotenow] An error occurred while fetching inputs: TypeError: Cannot read properties of null (reading 'join')

any ideas any one?

MrAsterisco commented 2 years ago

Hi @kris0616 !

That error, as already reported multiple times in other issues, just means that the connection to the TV failed or that the TV isn’t responding with the expected format.

Are you able to test with a MQTT explorer to see how your TV communicates?