MrAsterisco / homebridge-hisense-tv

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

V3.0.0 Plugin crashes repeatedly #68

Closed uberbobo closed 5 days ago

uberbobo commented 2 weeks ago

Describe The Bug: Plugin crashes when TV is off

To Reproduce: Use a TV that does not stay powered on, turn it off and wait for plugin to crash

Expected behavior: Does not crash. Maybe with a try/catch e.g.

Writable.prototype.write = function (chunk, encoding, cb) {
  try {
    return _write(this, chunk, encoding, cb) === true
  } catch (err) {
    return err;
  }
}

Logs:

[31/08/2024, 09:21:45] [homebridge-hisense-tv-remotenow] An error occurred while connecting to MQTT service: {"errno":-113,"code":"EHOSTUNREACH","syscall":"connect","address":"10.0.1.73","port":36669}
TypeError: Cannot read properties of undefined (reading 'startsWith')
    at HiSenseTVAccessory.setAlwaysOnFakeSleepState (file:///usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/src/platformAccessory.ts:561:44)
    at MqttClient.<anonymous> (file:///usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/src/platformAccessory.ts:175:18)
    at MqttClient.emit (node:events:518:28)
    at handlePublish (/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/node_modules/mqtt/src/lib/handlers/publish.ts:172:11)
    at handle (/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/node_modules/mqtt/src/lib/handlers/index.ts:31:17)
    at work (/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/node_modules/mqtt/src/lib/client.ts:773:17)
    at Writable.writable._write (/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/node_modules/mqtt/src/lib/client.ts:797:4)
    at writeOrBuffer (/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/node_modules/readable-stream/lib/internal/streams/writable.js:334:12)
    at _write (/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
    at Writable.write (/usr/local/lib/node_modules/homebridge-hisense-tv-remotenow/node_modules/readable-stream/lib/internal/streams/writable.js:286:10)

Plugin Config:

{
    "macaddress": "e4:5f:01:xx:xx:xx",
    "devices": [
        {
            "id": "HiSense55TV",
            "name": "PlayroomHisense",
            "showApps": false,
            "apps": [
                "Netflix",
                "Prime Video",
                "Disney+",
                "Peacock TV",
                "Peacock TV",
                "Paramount+",
                "Hulu"
            ],
            "tvType": "fakeSleep",
            "pollingInterval": 4,
            "wolInterval": 400,
            "wolRetries": 3,
            "ipaddress": "10.0.1.44",
            "macaddress": "a0:62:fb:xx:xx:xx",
            "sslmode": "default"
        },
        {
            "id": "HiSense65TV",
            "name": "MainHisense",
            "showApps": false,
            "tvType": "default",
            "pollingInterval": 4,
            "wolInterval": 400,
            "wolRetries": 3,
            "ipaddress": "10.0.1.73",
            "macaddress": "5c:34:00:xx:xx:xx",
            "sslmode": "default"
        }
    ],
    "_bridge": {
        "username": "0E:7B:6E:xx:xx:x",
        "port": 50039
    },
    "platform": "HiSenseTV"
}

Screenshots:

Environment:

MrAsterisco commented 1 week ago

@LeLunZ this seems a pretty important issue. Are you able to check it out?

LeLunZ commented 1 week ago

Yes! I didn’t see the bug report :) seems I don’t get notifications for new issues. Will check if I can change that


Got it working by changing my "Watch State" for the repository :)

LeLunZ commented 1 week ago

@uberbobo it seems the issue is with your HiSense55TV. is the "tvType" set correctly? Did you get the tvType from the "hisense-tv-always-on-test" script?

You say "Use a TV that does not stay powered on, turn it off and wait for plugin to crash". For me that sounds like it doesn't just sleep but really turns off. In that case "tvType" should be set to "default". Or is that a tv that fake sleeps and in cases it fully does get turned off, the plugin crashes?

Also this issue showed me that we need some kind of way to see which mqtt messages caused an error: So I will add an error handler where if an error is thrown we can see which mqtt message caused the error. So we can debug these issues better!

LeLunZ commented 1 week ago

@uberbobo I created a beta version where a try/catch is wrapped around the part where you found an error. It should also print the message that caused the error to the home bridge log. Could you provide the part where it says "Error occurred while handling new message from TV....." and the message below that?

You can install it through the home bridge ui by going to the plugins. Clicking on the 3 dots in the Hisense-tv plugin box, and clicking manage versions.

There should be a dropdown, where version 3.0.1 beta.1 is now available.

uberbobo commented 1 week ago

hisense-tv-always-on-test doesn't work for me. Here is what I tried.

pi@homebridge:/var/lib/homebridge $ hisense-tv-always-on-test
Turn your TV off now and press enter when ready: Running first test to determine if TV is always on or off
Wait for a few seconds...Connection failed
Please check if the TV is on and connected to the same network
In case the TV doesn     need a ssl connection, use the --no-ssl flag
In case the TV needs a custom ssl connection, use the --certfile and --keyfile flags
Error message: Cannot read properties of undefined (reading 'toUpperCase')pi@homebridge:/var/lib/homebridge $ 
pi@homebridge:/var/lib/homebridge $ hisense-tv-always-on-test --hostname 10.0.1.44
Turn your TV off now and press enter when ready: Running first test to determine if TV is always on or off
Wait for a few seconds...Connection failed
Please check if the TV is on and connected to the same network
In case the TV doesn     need a ssl connection, use the --no-ssl flag
In case the TV needs a custom ssl connection, use the --certfile and --keyfile flags
Error message: Cannot read properties of undefined (reading 'toUpperCase')pi@homebridge:/var/lib/homebridge $ 
pi@homebridge:/var/lib/homebridge $ ping 10.0.1.44
PING 10.0.1.44 (10.0.1.44) 56(84) bytes of data.
64 bytes from 10.0.1.44: icmp_seq=1 ttl=64 time=0.352 ms
64 bytes from 10.0.1.44: icmp_seq=2 ttl=64 time=0.385 ms
^C
--- 10.0.1.44 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1062ms
rtt min/avg/max/mdev = 0.352/0.368/0.385/0.016 ms
pi@homebridge:/var/lib/homebridge $ 
LeLunZ commented 1 week ago

Thx for reporting :)

The scripts hisense-tv-always-on-test / and hisense-tv-authorize need to be run with the flags --hostname and --mac <macAddressOfHomebridgeInstance/the one you configured in the config.json as top level Mac address> Also make sure the you ran the hisense-tv-authorize script before using the always-on-test script.

Sorry if that wasn't clear :) I will add a --help flag to the scripts which prints out all the configuration options. I will also print them if there is a flag missing in the input 👍

Also big thx for testing out the scripts, it's really hard for me to validate stuff because there are so many different TVs out there. So I am kind of relying on bug reports :D

Also do you have any new output in your home bridge logs/protocol? It would be nice to see why the plugin crashed on you all the time. And if you had the time to add the --mac flag could you report back on the output of the scripts?

uberbobo commented 1 week ago

Still failed ☹️ I tried both with the tv on/on and on/off

pi@homebridge:/var/lib/homebridge $ hisense-tv-always-on-test --hostname 10.0.1.44 --mac e4:5f:01:xx:xx:xx
Turn your TV off now and press enter when ready: Running first test to determine if TV is always on or off
Wait for a few seconds...Connection failed
Please check if the TV is on and connected to the same network
In case the TV doesn     need a ssl connection, use the --no-ssl flag
In case the TV needs a custom ssl connection, use the --certfile and --keyfile flags
Error message: ENOENT: no such file or directory, open ''

Oddly I'm not seeing any errors or new logs.

LeLunZ commented 1 week ago

@uberbobo thx for sharing that helped a lot! The new error is happening here:

Error message: ENOENT: no such file or directory, open ''

With this clue I found a bug where in the scripts, I didn't handle the ssl mode "default" correctly. It still assumed that there should be a cert/key file even though that's wrong.

I just fixed that and provided a new beta for you to try out. I really hope that this fixes the issue :)

uberbobo commented 1 week ago

Installed Beta2. It connects 😄 but hangs trying to determine if fake sleep mode

pi@homebridge:/var/lib/homebridge $ hisense-tv-always-on-test --hostname 10.0.1.44 --mac e4:5f:01:89:a4:0b
Running first test to determine if TV is always on or off
Turn your TV off now and press enter when ready: 

Wait for a few seconds...
Always on TV detected
Running second test to determine if Always On TV has Fake Sleep Mode
Wait for a few seconds...

Seems there is no timeout or way to turn on additional debug in the script.

I also saw additional logs when it restarted

[04/09/2024, 17:30:48] [homebridge-hisense-tv-remotenow] An error occurred while connecting to MQTT service: {"errno":-113,"code":"EHOSTUNREACH","syscall":"connect","address":"10.0.1.73","port":36669}
[04/09/2024, 17:30:48] [homebridge-hisense-tv-remotenow] This usually means the TV is off/the IP address is incorrect or you configured the wrong ssl options.
LeLunZ commented 1 week ago

Thx for testing. So, this night was very productive. (Beta 4 is out now) I rewrote the scripts to be better editable by me, and added more errors/debug options.

For your 65U6G TV I checked (if it's the 2021 model) it should be picture mode DEFAULT. (its not always on) Just make sure you ran the authorize command 2 times (for both tvs). And check again if the plugin in home bridge works or if it crashes home bridge.

Looking forward to hearing from you :D


Other information:

The scripts utilities changed and are now accessible by calling hisense-tv authorize (dash removed) and hisense-tv always-on-test. I also added a debug function where you can listen to all mqtt messages and see them in the console. hisense-tv listen-to-mqtt --hostname <hostname> --mac <macOfHomebridge> --<otheroptions>

uberbobo commented 1 week ago

Thanks for the work on this plugin. I don't see any crashes with Beta2. I also hacked at the test always on script to listen to all mqtt and tried looking at what was going on with my 55 U7G that is always on. It does not have the fake sleep state flag in the gettvstate and the picture settings do not change on when the power is toggled. I found some things that might be of use.:

The picture settings the broadcast topic gets changes.
/remoteapp/mobile/broadcast/platform_service/data/picturesetting

e.g. the message starts with {"action":"notify_value_changed","menu_info":

I don't think there needs to be an unsubscribe when testing the power toggle. You can query the values explicitly but the results are not broadcast. { "action": "get_menu_info" } /remoteapp/tv/platform_service/E4:5F:01:xx:xx:xx$normal/actions/picturesetting Returns the picture info (results abbreviated) > {"action":"resp_get_menu_info","menu_info":[ ... /remoteapp/mobile/E4:5F:01:xx:xx:xx$normal/platform_service/data/picturesetting

My TV had a fake sleep state flag that did not change in /remoteapp/tv/platform_service/E4:5F:01:xx:xx:xx$normal/actions/gettvinfo

I saw no mqtt messages when the TV was powered on, but the remote now app immediately saw the state change. Might be info sent on another port

The power off for the TV can be reliably seen via /remoteapp/mobile/broadcast/platform_service/actions/tvsleep

But like I said the on can not be determined by either supported method. My TV eARCs to a receiver so in y case volume change could be used, but there has to be a better way. I haven't had the time to look at the network traffic and probably won't get a chance soon. I'll put on beta4 soon, to confirm and then close the issue.

Thanks for fixing the crash.

LeLunZ commented 1 week ago

Interesting. Thx for all the information.

I just want to get some clarification from you. In the always on test script I send a message to the topic /remoteapp/tv/platform_service/E4:5F:01:xx:xx:xx$normal/actions/picturesetting to try to get the TV to send all the picture settings.

But that doesn’t seems to work, that’s why your script didn’t continue.

With the above topic do you need to send: { "action": "get_menu_info" } as MQTT message to get the tv to respond? Thats something I am not yet doing. And I probably missed because I don’t have a always on tv.

—-

But if you say the sleep state can be seen in this topic: /remoteapp/mobile/broadcast/platform_service/actions/tvsleep I can just add another always on tv type. And listen to this topic in the plugin to change the state in homebridge.

Is there any message send together with this topic? (Something that indicates the sleep started or ended) or is there another topic that tells you the tv woke up?

LeLunZ commented 1 week ago

@uberbobo With { "action": "get_menu_info" } I can even get the picture settings on my older tv. Great! I have added that in beta 8. So the always on test script should now work.

Please give also feedback on that, if you have the time to try it out :)

And could you also run hisense-tv listen-to-mqtt --hostname <hostname> --Mac <homebridgeMac> --path "/remoteapp/mobile/broadcast/platform_service/data/picturesetting"

And turn your tv on and off. And see what messages are getting reported? That would be amazing!

uberbobo commented 1 week ago

This 55" is super wonky. In the home/andriod tv screen there is no picture settings change on power cycle and no seemingly reliable way to tell the TV has turned on especially in the android TV home screen. The tvsleep topic only gets posted when the TV is powered off.

No crashes. I'll post an enhancement request if something becomes obvious.

Here's the requested output plus a little more.

pi@homebridge:/var/lib/homebridge $ hisense-tv listen-to-mqtt --hostname 10.0.1.44 --mac e4:5f:01:xx:xx:xx  --path "#"
Connected to MQTT server
Subscribing to #

# no input - set to android tv home screen and no application selected

#power off
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/tvsleep: 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 

#power on 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/volumechange: {"volume_type":2,"volume_value":0}
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/volumechange: {"volume_type":1,"volume_value":41}

# with input set to HDMI 3 (eARC)

#power off
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/tvsleep: 
> Received message on topic /remoteapp/mobile/broadcast/platform_service/data/picturesetting: {"action":"notify_value_changed","menu_info":[{"menu_flag":0,"menu_id":1,"menu_name":"Dynamic Backlight control","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":2,"menu_name":"Backlight Level","menu_value":80,"menu_value_type":"int"},{"menu_flag":1,"menu_id":3,"menu_name":"Mode","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":4,"menu_name":"Pciture Mode","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":5,"menu_name":"Game","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":6,"menu_name":"Contrast","menu_value":50,"menu_value_type":"int"},{"menu_flag":1,"menu_id":7,"menu_name":"Brightness","menu_value":50,"menu_value_type":"int"},{"menu_flag":1,"menu_id":8,"menu_name":"color","menu_value":50,"menu_value_type":"int"},{"menu_flag":1,"menu_id":9,"menu_name":"Tint","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":10,"menu_name":"Sharpness","menu_value":25,"menu_value_type":"int"},{"menu_flag":1,"menu_id":11,"menu_name":"AspectRatio","menu_value":3,"menu_value_type":"int"},{"menu_flag":1,"menu_id":12,"menu_name":"Direct","menu_value":0,"menu_value_type":"int"},{"menu_flag":-1,"menu_id":13,"menu_name":"Dot-By-Dot","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":14,"menu_name":"Panoramic","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":15,"menu_name":"Cinema","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":16,"menu_name":"Overscan","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":17,"menu_name":"ColorTemperature","menu_value":2,"menu_value_type":"int"},{"menu_flag":191,"menu_id":18,"menu_name":"Motion Enhancement","menu_value":4,"menu_value_type":"int"},{"menu_flag":1,"menu_id":19,"menu_name":"Judder Reduction","menu_value":5,"menu_value_type":"int"},{"menu_flag":1,"menu_id":20,"menu_name":"Blur Reduction","menu_value":5,"menu_value_type":"int"},{"menu_flag":1,"menu_id":21,"menu_name":"Noise Reduction","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":22,"menu_name":"Digital Noise Reduction","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":23,"menu_name":"Hdmi Dynamic Range","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":24,"menu_name":"Active Contrast","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":25,"menu_name":"color space","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":26,"menu_name":"color(colorTuneColor)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":27,"menu_name":"Hue(colorTuneHue)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":28,"menu_name":"Saturation(ColorTunerSaturation)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":29,"menu_name":"Brightness(ColorTunerBrightness)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":30,"menu_name":"Reset(ResetColorTuner)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":31,"menu_name":"R-offset","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":32,"menu_name":"G-offset","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":33,"menu_name":"B-offset","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":34,"menu_name":"R-Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":35,"menu_name":"G-Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":36,"menu_name":"B-Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":37,"menu_name":"Reset(2 point)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":38,"menu_name":"20 point","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":39,"menu_name":"level","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":40,"menu_name":"Red","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":41,"menu_name":"Green","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":42,"menu_name":"Blue","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":43,"menu_name":"Reset(2o point)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":44,"menu_name":"Gamma","menu_value":1,"menu_value_type":"int"},{"menu_flag":1,"menu_id":45,"menu_name":"Input level","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":46,"menu_name":"Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":47,"menu_name":" Restore Gamma Calibration","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":48,"menu_name":"RGB only","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":49,"menu_name":"Apply Picture Settings","menu_value":1,"menu_value_type":"int"},{"menu_flag":1,"menu_id":50,"menu_name":"Reset(ResetPictureSettings)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":51,"menu_name":"Local Dimming","menu_value":2,"menu_value_type":"int"}],"pic_setting_version":"U4"}
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 

#power on 
> Received message on topic /remoteapp/mobile/broadcast/platform_service/data/picturesetting: {"action":"notify_value_changed","menu_info":[{"menu_flag":0,"menu_id":1,"menu_name":"Dynamic Backlight control","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":2,"menu_name":"Backlight Level","menu_value":80,"menu_value_type":"int"},{"menu_flag":1,"menu_id":3,"menu_name":"Mode","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":4,"menu_name":"Pciture Mode","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":5,"menu_name":"Game","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":6,"menu_name":"Contrast","menu_value":50,"menu_value_type":"int"},{"menu_flag":1,"menu_id":7,"menu_name":"Brightness","menu_value":50,"menu_value_type":"int"},{"menu_flag":1,"menu_id":8,"menu_name":"color","menu_value":50,"menu_value_type":"int"},{"menu_flag":1,"menu_id":9,"menu_name":"Tint","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":10,"menu_name":"Sharpness","menu_value":25,"menu_value_type":"int"},{"menu_flag":1,"menu_id":11,"menu_name":"AspectRatio","menu_value":3,"menu_value_type":"int"},{"menu_flag":1,"menu_id":12,"menu_name":"Direct","menu_value":0,"menu_value_type":"int"},{"menu_flag":-1,"menu_id":13,"menu_name":"Dot-By-Dot","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":14,"menu_name":"Panoramic","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":15,"menu_name":"Cinema","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":16,"menu_name":"Overscan","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":17,"menu_name":"ColorTemperature","menu_value":2,"menu_value_type":"int"},{"menu_flag":191,"menu_id":18,"menu_name":"Motion Enhancement","menu_value":4,"menu_value_type":"int"},{"menu_flag":1,"menu_id":19,"menu_name":"Judder Reduction","menu_value":5,"menu_value_type":"int"},{"menu_flag":1,"menu_id":20,"menu_name":"Blur Reduction","menu_value":5,"menu_value_type":"int"},{"menu_flag":1,"menu_id":21,"menu_name":"Noise Reduction","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":22,"menu_name":"Digital Noise Reduction","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":23,"menu_name":"Hdmi Dynamic Range","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":24,"menu_name":"Active Contrast","menu_value":2,"menu_value_type":"int"},{"menu_flag":1,"menu_id":25,"menu_name":"color space","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":26,"menu_name":"color(colorTuneColor)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":27,"menu_name":"Hue(colorTuneHue)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":28,"menu_name":"Saturation(ColorTunerSaturation)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":29,"menu_name":"Brightness(ColorTunerBrightness)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":30,"menu_name":"Reset(ResetColorTuner)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":31,"menu_name":"R-offset","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":32,"menu_name":"G-offset","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":33,"menu_name":"B-offset","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":34,"menu_name":"R-Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":35,"menu_name":"G-Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":36,"menu_name":"B-Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":37,"menu_name":"Reset(2 point)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":38,"menu_name":"20 point","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":39,"menu_name":"level","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":40,"menu_name":"Red","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":41,"menu_name":"Green","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":42,"menu_name":"Blue","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":43,"menu_name":"Reset(2o point)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":44,"menu_name":"Gamma","menu_value":1,"menu_value_type":"int"},{"menu_flag":1,"menu_id":45,"menu_name":"Input level","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":46,"menu_name":"Gain","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":47,"menu_name":" Restore Gamma Calibration","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":48,"menu_name":"RGB only","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":49,"menu_name":"Apply Picture Settings","menu_value":1,"menu_value_type":"int"},{"menu_flag":1,"menu_id":50,"menu_name":"Reset(ResetPictureSettings)","menu_value":0,"menu_value_type":"int"},{"menu_flag":1,"menu_id":51,"menu_name":"Local Dimming","menu_value":2,"menu_value_type":"int"}],"pic_setting_version":"U4"}
Received message on topic /remoteapp/mobile/broadcast/ui_service/state: {}
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/sourceinsert: 
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/volumechange: {"volume_type":2,"volume_value":0}
Received message on topic /remoteapp/mobile/broadcast/platform_service/actions/volumechange: {"volume_type":1,"volume_value":41} 
LeLunZ commented 1 week ago

Ok, that really is a bit disappointing. Seems like your TV has really weird behavior.

One last thing. Could you check if you now run the always-on-test (with input set to HDMI3) that it finishes? (+ the logs would be appreciated)

At the end it should tell you what picture settings are different, but as yours are the same. There should be no output + the script should terminate.

If the always on script now works that would be amazing. I think then we can close this issue and merge the beta :D

uberbobo commented 5 days ago

Nothing of use when on HDMI3

pi@homebridge:/var/lib/homebridge $ hisense-tv always-on-test --hostname 10.0.1.44 --mac e4:5f:01:xx:xx:xx
Running first test to determine if TV is always on or off
Turn your TV OFF now and press enter when ready: 

Wait for a few seconds...
Always on TV detected
Running second test to determine if Always On TV has Fake Sleep Mode
Wait for a few seconds...
First test didn't detect always on mode.
Continuing with Picture Settings Test
Wait a few seconds...
Turn your TV on now and press enter when ready:
pi@homebridge:/var/lib/homebridge $ 
LeLunZ commented 5 days ago

Yeah, that was to be expected. As you didn't see any changes before in your logs. But now it's exiting the script correctly. Which is good. I will merge/publish the v3.0.1 version now.

And thus I will close this issue. Thx for testing everything, you have helped quite a lot! If you find any other issue, or find a way to get your tv working let me know :D