eslavnov / pylips

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

[FEAT] "Follow Sound" Ambilight with a custom color #70

Open Trilyan opened 4 years ago

Trilyan commented 4 years ago

Official Phillips app has the ability to set ambilight to "Follow Sound" and then pick a specific color to avoid the "rainbow effect".

I tried replicating this with custom commands without success, not even with CURL. Seems like the app does something different...

This is what I GET with this mode active:

GET /6/ambilight/currentconfiguration:

"styleName":"FOLLOW_AUDIO", "isExpert":true, "audioSettings":{

"color":{"hue":165,"saturation":251,"brightness":140}, "colorDelta":{"hue":0,"saturation":0,"brightness":140}, "tuning":2," algorithm":"ENERGY_ADAPTIVE_COLORS"}

Findings:

"algorithm": will show the name of the next algorithm on the list, and not the one currently active (weird). Trying to POST different algorithms will overlap the defined color for some reason

"color delta": seems to be an additional color you can pick and mix with the first color. Some algorithms will bounce back and forth between these 2, but it usually overlaps them together and creates a new color

"tuning": No matter what I POST here, it remains at 2 when I do a GET

I tried doing a MITM Proxy to understand what the app is POSTING to make the color stay put, but I'm stuck at app pairing. If I pair the app without the proxy, then it won't reach the TV once connected to the proxy again.

Having pylips include this command would be great, as I'm not really a fan of the "rainbow" approach.