jomwells / ambihue

ON/OFF Abilight+Hue (Switch) component for Philips Ambilight TV's
9 stars 9 forks source link

Switch is not changing to "on" status #1

Open Molodax opened 5 years ago

Molodax commented 5 years ago

I've updated the switch and it looks like it does not change the status to "on" anymore when it is actually on. I have this in the log:

Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service connection.context(msg)) File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call self._execute_service(handler, service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service await handler.func(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service required_features File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call await getattr(entity, func)(*data) 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/ambihue/switch.py", line 66, in turn_on self._postReq('menuitems/settings/update', {"values":[{"value":{"Nodeid":2131230774,"Controllable":"true","Available":"true","data":{"value":"true"}}}]} ) File "/config/custom_components/ambihue/switch.py", line 109, 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)

SBRK commented 4 years ago

I have the same issue :(

SBRK commented 4 years ago

@Molodax @jomwells I found the culprit. On my TV (OLED804, released really recently), the node id for ambilight_hue_off has changed. It is not 2131230774 anymore, it is instead 2131230778. One quick fix would be to add an override in the config for the node id to use, and a more sustainable fix would be to query menuitems/settings/structure to get the right node id for ambilight_hue_off. I would do it, but my python experience is pretty small, and I'm not too sure how to develop and debug a Home Assistant component.

basziee commented 4 years ago

I have a 55pus830312 and the nodeid isn't 2131230774 or 2131230778

PostSven commented 4 years ago

I have a 55pus830312 and the nodeid isn't 2131230774 or 2131230778

You can figure out your nodeid using pylips or by browsing to: https://TVIP:1926/6/menuitems/settings/structure and look for ambilight_hue_off

jimmyeao commented 4 years ago

I have a 55pus830312 and the nodeid isn't 2131230774 or 2131230778

You can figure out your nodeid using pylips or by browsing to: https://TVIP:1926/6/menuitems/settings/structure and look for ambilight_hue_off

Mine prompts for a username and password? any ideas?