Philips Android TV Ambilights (Light) component

Can you show us exactly what you put in as the command please?

WhimsySpoon Thanks for your reply,

Finally today the script worked well. I do not know why it did not work before, the only difference between the first test and the one that worked was that I did not use the television for about 24 hours.

Did you manage to fix the unavailable ?

well, yes… that would be really appreciated.
I dl’d the philips_tv.py file, but get this when I run it:

-bash: /Users/theboss/Desktop/philips_tv.py: Permission denied

Of course I want to use this: https://github.com/jomwells/ambilights but the above is needs for it, am I correct?

so How can I run the philips.py to create username and password?

Does no one else face this issue?

Looks like that comes from the Philips_android_tv (media_player) component, try asking here :slightly_smiling_face:

1 Like

You have to get your credentials using another script.You can get this script on this repository : https://github.com/suborb/philips_android_tv

There is a tutorial (in French) at this url : https://www.skipcool.ovh/2019/01/16/piloter-une-tv-philips-ambilight-recente-par-ligne-de-commande/

Hi, I have a 55PUS7304 (aka “The One” 2019) and I’m experiencing the same thing. Android App doesn’t work even when I input the ip manualy; when i try to access it in the browser I get ERROR 500, but the port 1925 is open. I tried everything. I cannot access the api or pair it.
How did you solve this?

Factory reset of the TV fixed it immediately. Was annoying as I had otherwise got the TV configured exactly how I wanted it, although not yet calibrated. As soon as it was reset, the endpoint was returning 200s instead of 500s.

I know we don’t have the same model, but the endpoint I had to use was https://x.x.x.x:1926/6/system to get any kind of response. Nothing is listening on port 1925 for me.

Why works for me same BASE_URL = ‘https://{0}:1926/5/{1}’ in Philips Android TV (media_player) but not in Philips Android TV (ambilight) ?

Log Details (ERROR)
Mon Dec 23 2019 11:55:17 GMT+0100 (stredoeurópsky štandardný čas)
Update for light.ambilight fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 281, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 461, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/philips_ambilight/light.py”, line 227, in update
self.getState()
File “/config/custom_components/philips_ambilight/light.py”, line 161, in getState
fullstate = self._getReq(‘ambilight/currentconfiguration’)
File “/config/custom_components/philips_ambilight/light.py”, line 273, in _getReq
return json.loads(resp.text)
File “/usr/local/lib/python3.7/json/init.py”, line 348, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.7/json/decoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.7/json/decoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Great component.
However i keep getting inconsistent replies ( i cannot tell why sometimes it works and sometimes not)

this is the error log:

2020-01-22 17:18:00 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.ambilight_switch fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/philips_ambilight+hue/switch.py", line 87, in update
    self.getState()
  File "/config/custom_components/philips_ambilight+hue/switch.py", line 77, in getState
    ahstat = fullstate['values'][0]['value']['data']['value']
KeyError: 'data'```

Hi BlodKolle,

i am in the same situation and have one of the (rare) devices that are on SAPHI.
Did you do any further tweaking/optimization of the component.

I do have VERY inconsistent expereinces with the component so far in regards of status received by the components and commands to be sent…

cheers

Hi,

I made an issue to Github:

Problem is that you can’t set color and brightness at the same time using an automation. Could you split these request to two different request in the code to get it working?

I use two of these hacs integrations: ambilight+hue and ambilight (Lights) component

The ambilights work like a charm (but isn’t realy needed for me) and also the ambihue is still working, but using ambihue I allways get this errors by toggle switch posting turn_on/-_off command (same in node red to HA):

Logger: homeassistant.components.websocket_api.http.connection.548134744656
Integration: websocket_api (documentation, issues)
First occured: ...
Last logged: 15:14:11

Expecting value: line 1 column 1 (char 0)

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1230, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 402, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 433, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 615, in async_turn_on
    await self.hass.async_add_job(ft.partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/philips_ambilight+hue/switch.py", line 68, in turn_on
    self._postReq('menuitems/settings/update', {"values":[{"value":{"Nodeid":2131230774,"Controllable":"true","Available":"true","data":{"value":"true"}}}]} )
  File "/config/custom_components/philips_ambilight+hue/switch.py", line 111, in _postReq
    return json.loads(resp.text)
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I’ve allready seen a similar error on https://github.com/jomwells/ambihue/issues without any comment of the dev or an update or fix of this that work for me… The Node_ID changing doesn’t work for me like in issues commented by SBRK.

Hope for an answer…

cheers Chris

1 Like

Hi, my setup is a Home Assistant, an Android TV Philips 55pos9002 with Ambilight on 3 sides and 2 yeelight (a bulb and a led stripe). I was able to configure everything and it was working really good but after the last HA update (or HACS can’t remember) it’s not working as it used to.

Now only one bulb is working at a time and I’m not able to turn both of them on at the same time. Sometimes even the bulb turns on automatically with the TV and sometimes the led stripe.
I tried reinstalling but not working, anyone else with the same problem? or a solution.

Thanks

Same for me, i have even checked the correct nodeid…

So i kinda got it half working :slight_smile:

nodeid for my TV is different, so i changed that in the code, but it appears that there is something else that has changed as well, i figured it out using pylips.

menuitems/settings/update --body '{ "values": [{ "value": { "Nodeid": 2131230778, "Controllable": false, "Available": true, "data": { "value": true } } }] }'

"Controllable": false,

i changed all of that in the code, and now i can turn on/off the ambilight+hue, but i still receive the error in the log.

Don’t know what it is… No answer from dev here nor privat … nor info where to look for the issue, if it is an issue of websocket_api, ambihue or pylibs?

Yeah it functionaly works, but the error is still listed… mmhh

Is that on the philips ambilight py?
I am using yeelight component and it works good, lights are sync and changes colours but now the behaviour is not the expected, as I said they turn on and off as they want and only one at a time. Can’t find the problem.

Hi,

I added support for transition. You can make smooth transition between RGB colors. Pretty awesome.
I didn’t make pull request yet, if you guys wan’t to test it out first.

I’ve tested it and it seems to be working.