eslavnov / pylips

Control Philips TVs (2015+) and Ambilight (+ Hue) through their reverse-engineered API (+ MQTT support!)
MIT License
334 stars 58 forks source link

2020 Android TV Ambilight "lounge lights" doesn't respond[BUG] #107

Open Jonoox opened 3 years ago

Jonoox commented 3 years ago

2020 TV 50PUS8535/12 (TPM191E platform as in 2019) When i set eg. Hot Lava from Philips Remote control app in current configuration I get: {"styleName":"Lounge light","isExpert":false,"menuSetting":"HOT_LAVA","stringValue":"Hot Lava"} In JSON there is:

        "ambilight_color_hot_lava": {
            "path": "ambilight/currentconfiguration",
            "body": {
                "styleName": "FOLLOW_COLOR",
                "isExpert": "false",
                "menuSetting": "HOT_LAVA",
                "stringValue": "Hot Lava"
            }
        },

I changed the body to match style name:

        "ambilight_color_hot_lava": {
            "path": "ambilight/currentconfiguration",
            "body": {
                "styleName": "Lounge light",
                "isExpert": "false",
                "menuSetting": "HOT_LAVA",
                "stringValue": "Hot Lava"
            }

But it still doesn't respond. I can get Lounge Lights when I send 'ambilight_onoff' command because it can toggle between them as on physical remote control but can't set it to Hot Lava nor other 'Lounge' colours. /currentconfiguration as set every 'color mode' from Android phone app

{"styleName":"Lounge light","isExpert":false,"menuSetting":"HOT_LAVA","stringValue":"Hot Lava"}
{"styleName":"Lounge light","isExpert":false,"menuSetting":"DEEP_WATER","stringValue":"Deep Water"}
{"styleName":"Lounge light","isExpert":false,"menuSetting":"FRESH_NATURE","stringValue":"Fresh Nature"}
{"styleName":"Lounge light","isExpert":false,"menuSetting":"ISF","stringValue":"Warm White"}
{"styleName":"Lounge light","isExpert":false,"menuSetting":"CUSTOM_COLOR"}
{"styleName":"FOLLOW_VIDEO","isExpert":true}

/supportedstyles {"supportedStyles":[{},{},{"styleName":"FOLLOW_AUDIO","algorithms":["ENERGY_ADAPTIVE_BRIGHTNESS","ENERGY_ADAPTIVE_COLORS","VU_METER","SPECTRUM_ANALYZER","KNIGHT_RIDER_CLOCKWISE","KNIGHT_RIDER_ALTERNATING","RANDOM_PIXEL_FLASH","STROBO","PARTY"],"maxTuning":2},{"styleName":"Lounge light","algorithms":["MANUAL_HUE","AUTOMATIC_HUE"],"maxSpeed":255},{},{},{},{},{},{}]}

I tried sniffing what the app is sending with httpcanary but it doesn't seem to work fine with my phone. Any ideas?

aegjoyce commented 2 years ago

Hi all - I have fixed this issue and included it in my reworked version of jomwells' ambilight component. Have a look at light.py in my repository: https://github.com/aegjoyce/ambilights/

Scraped these commands from the official Philips Remote app. You'll see that the endpoint it targets for changing mode is now menuitems/settings/update rather than what you have been targeting

Let me know if this fixes your issue! @eslavnov

Jonoox commented 2 years ago

@aegjoyce thank you, your version works great with my TV.