Philips TV (2016+) Binding

Hi guys!

Wanna report that I’m testing this binding with a 49PUS8303 - just bought it yesterday…
I’m also trying different things with curl from command line.
Here’s my findings…
First, I confirm that, after restarting openHAB the thing is OFFLINE - CONFIGURATION_ERROR and the pairing code was missing from thing configuration.
Managed to solve it by adding the thing manually with all parameters like this:

Thing philipstv:tv:F00DBABE_AA5E_BABA_DADA_70af24a6ee9a "Livingroom_TV" [host="192.168.200.33", port="1926", pairingCode="8635", username="NDAoG1KzXMuPZ5CP", password="ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115"]

Some strange thing is that the TV is not reporting the current channel… Weird, because yesterday I saw the channel name and also the channel image, but now, looking at the logs it says:

09:10:12.686 [DEBUG] [tv.internal.service.ConnectionService] - Target Uri is: https://192.168.200.33:1926/6/audio/volume
09:10:12.800 [DEBUG] [tv.internal.service.ConnectionService] - ----------------------------------------
09:10:12.801 [DEBUG] [tv.internal.service.ConnectionService] - HTTP/1.1 200 OK
09:10:12.802 [DEBUG] [tv.internal.service.ConnectionService] - {"muted":true,"current":0,"min":0,"max":60}
09:10:12.806 [DEBUG] [tv.internal.service.ConnectionService] - Target Uri is: https://192.168.200.33:1926/6/activities/current
09:10:12.909 [DEBUG] [tv.internal.service.ConnectionService] - ----------------------------------------
09:10:12.910 [DEBUG] [tv.internal.service.ConnectionService] - HTTP/1.1 200 OK
09:10:12.911 [DEBUG] [tv.internal.service.ConnectionService] - {"component":{"packageName":"NA","className":"NA"}}

About Ambilight… Turn it off works, but turning it back on set the Ambilight to ‘follow color’, not ‘follow video’ - previous setting. Also, the binding doesn’t read the current Ambilight configuration.
One idea would be to stop using /ambilight/power and switch over to /ambilight/currentconfiguration and pooling it to get the config.
@bennYx0x, maybe you could take this into consideration?
Here’s some curl examples:

# getting Ambilight supported modes
$ curl -X GET --digest --insecure -u NDAoG1KzXMuPZ5CP:ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115 https://192.168.200.33:1926/6/ambilight/supportedstyles
{"supportedStyles":[{"styleName":"OFF"},{"styleName":"FOLLOW_VIDEO"},{"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":"FOLLOW_COLOR","algorithms":["MANUAL_HUE","AUTOMATIC_HUE"],"maxSpeed":255},{"styleName":"LOUNGE"},{"styleName":"MANUAL"},{"styleName":"EXPERT"},{"styleName":"GRID"},{"styleName":"FLAG"},{"styleName":"APP"}]}

#getting current Ambilight config
$ curl -X GET --digest --insecure -u NDAoG1KzXMuPZ5CP:ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115 https://192.168.200.33:1926/6/ambilight/currentconfiguration
{"styleName":"FOLLOW_VIDEO","isExpert":false,"menuSetting":"STANDARD","stringValue":"Standard"}

# setting Ambilight to OFF
$  curl -X POST --digest --insecure -u NDAoG1KzXMuPZ5CP:ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115 -d '{"styleName":"OFF"}' https://192.168.200.33:1926/6/ambilight/currentconfiguration

$ curl -X GET --digest --insecure -u NDAoG1KzXMuPZ5CP:ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115 https://192.168.200.33:1926/6/ambilight/currentconfiguration
{"styleName":"OFF","isExpert":false}

# setting Ambilight to FOLLOW_VIDEO
$ curl -X POST --digest --insecure -u NDAoG1KzXMuPZ5CP:ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115 -d '{"styleName":"FOLLOW_VIDEO","isExpert":false,"menuSetting":"STANDARD","stringValue":"Standard"}' https://192.168.200.33:1926/6/ambilight/currentconfiguration

$ curl -X GET --digest --insecure -u NDAoG1KzXMuPZ5CP:ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115 https://192.168.200.33:1926/6/ambilight/currentconfiguration
{"styleName":"FOLLOW_VIDEO","isExpert":false,"menuSetting":"STANDARD","stringValue":"Standard"}

@bennYx0x - keep up the good work! :smile:

EDIT:
Here’s the TV response to a /system query:

$ curl -X GET --digest --insecure -u NDAoG1KzXMuPZ5CP:ade340a88b18db300b0ab7d19b06e3a656cc8d21834f88bd84302574bad1b115 https://192.168.200.33:1926/6/system
{"notifyChange":"http","menulanguage":"English","name":"Livingroom_TV","country":"Romania","serialnumber_encrypted":"s\/Z17thwTxN7n2P0bmCDVTrhq3kxB2wNxeRIgSSLQ9E=\n","softwareversion_encrypted":"P3OtbBqME0qwDhH4eDV9J9EaEk5pk+ZU7yZ3fMiGDzDlkliTQeMw1iLmU6RHjdJs\n","model_encrypted":"tjoYwzYg3f80h3XdRnKjmnx+SyWA7B4PJBjwmXk1rfo=\n","deviceid_encrypted":"tn8YWAYbFmqwi95xlq\/EnMeMPCs34jDrDSd3oYn1pkU=\n","nettvversion":"8.0.2","epgsource":"one","api_version":{"Major":6,"Minor":1,"Patch":0},"featuring":{"jsonfeatures":{"editfavorites":["TVChannels","SatChannels"],"recordings":["List","Schedule","Manage"],"ambilight":["LoungeLight","Hue","Ambilight"],"menuitems":["Setup_Menu"],"textentry":["context_based","initial_string_available","editor_info_available"],"applications":["TV_Apps","TV_Games","TV_Settings"],"pointer":["not_available"],"inputkey":["key"],"activities":["intent"],"channels":["preset_string"],"mappings":["server_mapping"]},"systemfeatures":{"tvtype":"consumer","content":["dmr","pvr"],"tvsearch":"intent","pairing_type":"digest_auth_pairing","secured_transport":"true","companion_screen":"true"}},"os_type":"MSAF_2018_O"}