Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi Philips Ambient Light doesn't work #16269

Closed
OleksandrBerchenko opened this issue Aug 29, 2018 · 15 comments · Fixed by #17259
Closed

Xiaomi Philips Ambient Light doesn't work #16269

OleksandrBerchenko opened this issue Aug 29, 2018 · 15 comments · Fixed by #17259
Assignees

Comments

@OleksandrBerchenko
Copy link
Contributor

Home Assistant release with the issue:

0.77.0

Last working Home Assistant release (if known):

n/a

Operating environment (Hass.io/Docker/Windows/etc.):

Virtualenv on Raspberry Pi

Component/platform:

https://www.home-assistant.io/components/light.xiaomi_miio/

Description of problem:

I have Philips Eyecare Smart Lamp (see configuration below). HA automatically detects it as two separate lights: light.philips_2 (main lamp) and light.philips_ambient_light_2 (weak lighting at the back). Main lamp works as expected, but Ambient Light doesn't:

  1. HA always says it's off regardless of it's actual state.
  2. When it's really off and I click on HA UI to turn it on, it actually turns on (together with the main lamp - that's fine), but in a second HA says it's off again. There is no way to turn Ambient Light off.

Below is what I see in the log:

2018-08-29 17:47:07 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=turn_on, service_data=entity_id=light.philips_ambient_light_2, domain=light>
2018-08-29 17:47:07 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]>
2018-08-29 17:47:14 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state light.philips_2=on; scene=1, delayed_turn_off=None, eyecare_mode=False, reminder=False, night_light_mode=True, supported_features=1, model=philips.light.sread1, friendly_name=Philips, brightness=13 @ 2018-08-29T17:47:14.134686+03:00>, entity_id=light.philips_2, old_state=<state light.philips_2=off; scene=1, delayed_turn_off=None, eyecare_mode=False, reminder=False, night_light_mode=True, supported_features=1, model=philips.light.sread1, friendly_name=Philips @ 2018-08-29T17:26:03.166265+03:00>>

The last state change refers the main lamp.

Thanks!

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

light:
  - platform: xiaomi_miio
    name: philips
    model: philips.light.sread1
    host: 192.168.1.89
    token: 846e47c324dbaeb7e9215fb85bae5378

Traceback (if applicable):

n/a

Additional information:

n/a

@syssi
Copy link
Member

syssi commented Aug 30, 2018

Please enable the debug log of the component & library by:

logger:
  default: warn
  logs:
    homeassistant.components.light.xiaomi_miio: debug
    miio: debug

Restart HA and reproduce the issue. Please provide the content of your home-assistant.log. Thanks in advance!

@OleksandrBerchenko
Copy link
Contributor Author

Sure.

  1. Everything is off, I turn Philips Ambient Light on using HA UI:
2018-08-30 23:07:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_data=entity_id=light.philips_ambient_light, domain=light, service=turn_on>
2018-08-30 23:07:03 DEBUG (Thread-3) [miio.device] 192.168.1.89:54321 >>: {'id': 9, 'method': 'enable_amb', 'params': ['on']}
2018-08-30 23:07:04 DEBUG (Thread-3) [miio.device] 192.168.1.89:54321 (ts: 1970-01-03 01:35:39, id: 9) << {'result': ['ok'], 'id': 9}
2018-08-30 23:07:04 DEBUG (MainThread) [homeassistant.components.light.xiaomi_miio] Response received from light: ['ok']
2018-08-30 23:07:04 DEBUG (Thread-5) [miio.device] 192.168.1.89:54321 >>: {'id': 10, 'method': 'get_prop', 'params': ['power', 'bright', 'notifystatus', 'ambstatus', 'ambvalue', 'eyecare', 'scene_num', 'bls', 'dvalue']}
2018-08-30 23:07:04 DEBUG (Thread-5) [miio.device] 192.168.1.89:54321 (ts: 1970-01-03 01:35:39, id: 10) << {'result': ['on', 40, 'off', 'on', 41, 'off', 1, 'on', 0], 'id': 10}
2018-08-30 23:07:04 DEBUG (MainThread) [homeassistant.components.light.xiaomi_miio] Got new state: <PhilipsEyecareStatus power=on, brightness=40, ambient=True, ambient_brightness=41, eyecare=False, scene=1, reminder=False, smart_night_light=True, delay_off_countdown=0>
2018-08-30 23:07:04 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]>
2018-08-30 23:07:05 DEBUG (Thread-16) [miio.device] 192.168.1.40:54321 >>: {'id': 6, 'method': 'get_prop', 'params': ['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'voltage', 'power_factor', 'elec_leakage']}
2018-08-30 23:07:05 DEBUG (Thread-16) [miio.device] 192.168.1.40:54321 (ts: 1970-01-11 15:05:15, id: 6) << {'result': ['on', 50, 86, 'normal', 10, 23520, 543, 8], 'id': 6}
2018-08-30 23:07:06 DEBUG (Thread-10) [miio.device] 192.168.1.89:54321 >>: {'id': 11, 'method': 'get_prop', 'params': ['power', 'bright', 'notifystatus', 'ambstatus', 'ambvalue', 'eyecare', 'scene_num', 'bls', 'dvalue']}
2018-08-30 23:07:06 DEBUG (Thread-7) [miio.device] 192.168.1.89:54321 >>: {'id': 12, 'method': 'get_prop', 'params': ['power', 'bright', 'notifystatus', 'ambstatus', 'ambvalue', 'eyecare', 'scene_num', 'bls', 'dvalue']}
2018-08-30 23:07:06 DEBUG (Thread-21) [miio.device] 192.168.1.42:54321 >>: {'id': 29, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:07:06 DEBUG (Thread-18) [miio.device] 192.168.1.54:54321 >>: {'id': 27, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:07:06 DEBUG (Thread-18) [miio.device] 192.168.1.54:54321 (ts: 1970-01-02 13:24:49, id: 27) << {'result': ['off', 47], 'id': 27}
2018-08-30 23:07:06 DEBUG (Thread-21) [miio.device] 192.168.1.42:54321 (ts: 1970-01-02 13:23:32, id: 29) << {'result': ['on', 50], 'id': 29}
2018-08-30 23:07:06 DEBUG (Thread-10) [miio.device] 192.168.1.89:54321 (ts: 1970-01-03 01:35:41, id: 11) << {'result': ['on', 40, 'off', 'on', 41, 'off', 1, 'on', 0], 'id': 11}
2018-08-30 23:07:06 DEBUG (MainThread) [homeassistant.components.light.xiaomi_miio] Got new state: <PhilipsEyecareStatus power=on, brightness=40, ambient=True, ambient_brightness=41, eyecare=False, scene=1, reminder=False, smart_night_light=True, delay_off_countdown=0>
2018-08-30 23:07:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state light.philips=on; night_light_mode=True, eyecare_mode=False, supported_features=1, friendly_name=Philips, brightness=102, scene=1, model=philips.light.sread1, reminder=False, delayed_turn_off=None @ 2018-08-30T23:07:06.502768+03:00>, entity_id=light.philips, old_state=<state light.philips=off; model=philips.light.sread1, eyecare_mode=False, supported_features=1, friendly_name=Philips, reminder=False, scene=1, night_light_mode=True, delayed_turn_off=None @ 2018-08-30T23:04:31.284512+03:00>>
2018-08-30 23:07:06 DEBUG (Thread-7) [miio.device] 192.168.1.89:54321 (ts: 1970-01-03 01:35:42, id: 12) << {'result': ['on', 40, 'off', 'on', 41, 'off', 1, 'on', 0], 'id': 12}
2018-08-30 23:07:06 DEBUG (MainThread) [homeassistant.components.light.xiaomi_miio] Got new state: <PhilipsEyecareStatus power=on, brightness=40, ambient=True, ambient_brightness=41, eyecare=False, scene=1, reminder=False, smart_night_light=True, delay_off_countdown=0>
2018-08-30 23:07:08 DEBUG (Thread-15) [miio.device] 192.168.1.171:54321 >>: {'id': 113, 'method': 'get_prop', 'params': ['power', 'aqi', 'average_aqi', 'humidity', 'temp_dec', 'mode', 'favorite_level', 'filter1_life', 'f1_hour_used', 'use_time', 'motor1_speed', 'motor2_speed', 'purify_volume', 'f1_hour', 'led']}
2018-08-30 23:07:08 DEBUG (Thread-15) [miio.device] 192.168.1.171:54321 (ts: 1970-01-02 13:25:46, id: 113) << {'result': ['on', 10, 8, 55, 165, 'favorite', 2, 45, 1895, 19434600, 742, None, 228772, 3500, 'off'], 'id': 113}
2018-08-30 23:07:08 DEBUG (Thread-15) [miio.device] 192.168.1.171:54321 >>: {'id': 114, 'method': 'get_prop', 'params': ['led_b', 'bright', 'buzzer', 'child_lock', 'volume', 'rfid_product_id', 'rfid_tag', 'act_sleep', 'sleep_mode', 'sleep_time', 'sleep_data_num', 'app_extra', 'act_det', 'button_pressed']}
2018-08-30 23:07:08 DEBUG (Thread-15) [miio.device] 192.168.1.171:54321 (ts: 1970-01-02 13:25:46, id: 114) << {'result': [2, None, 'off', 'off', None, None, None, 'close', 'silent', 81000, 0, 0, None, None], 'id': 114}
  1. Everything is off, I turn Philips Ambient Light on manually:
2018-08-30 23:09:24 DEBUG (Thread-5) [miio.device] 192.168.1.42:54321 >>: {'id': 52, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:09:24 DEBUG (Thread-15) [miio.device] 192.168.1.54:54321 >>: {'id': 50, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:09:24 DEBUG (Thread-15) [miio.device] 192.168.1.54:54321 (ts: 1970-01-02 13:27:07, id: 50) << {'result': ['off', 47], 'id': 50}
2018-08-30 23:09:24 DEBUG (Thread-5) [miio.device] 192.168.1.42:54321 (ts: 1970-01-02 13:25:51, id: 52) << {'result': ['on', 50], 'id': 52}
2018-08-30 23:09:30 DEBUG (Thread-3) [miio.device] 192.168.1.42:54321 >>: {'id': 53, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:09:30 DEBUG (Thread-9) [miio.device] 192.168.1.54:54321 >>: {'id': 51, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:09:30 DEBUG (Thread-3) [miio.device] 192.168.1.42:54321 (ts: 1970-01-02 13:25:56, id: 53) << {'result': ['on', 50], 'id': 53}
2018-08-30 23:09:31 DEBUG (Thread-9) [miio.device] 192.168.1.54:54321 (ts: 1970-01-02 13:27:14, id: 51) << {'result': ['off', 47], 'id': 51}
2018-08-30 23:09:36 DEBUG (Thread-6) [miio.device] 192.168.1.54:54321 >>: {'id': 52, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:09:36 DEBUG (Thread-7) [miio.device] 192.168.1.42:54321 >>: {'id': 54, 'method': 'get_prop', 'params': ['power', 'temperature']}
2018-08-30 23:09:36 DEBUG (Thread-6) [miio.device] 192.168.1.54:54321 (ts: 1970-01-02 13:27:19, id: 52) << {'result': ['off', 47], 'id': 52}
2018-08-30 23:09:36 DEBUG (Thread-7) [miio.device] 192.168.1.42:54321 (ts: 1970-01-02 13:26:03, id: 54) << {'result': ['on', 50], 'id': 54}
2018-08-30 23:09:40 DEBUG (Thread-16) [miio.device] 192.168.1.40:54321 >>: {'id': 11, 'method': 'get_prop', 'params': ['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'voltage', 'power_factor', 'elec_leakage']}
2018-08-30 23:09:40 DEBUG (Thread-16) [miio.device] 192.168.1.40:54321 (ts: 1970-01-11 15:07:50, id: 11) << {'result': ['on', 50, 87, 'normal', 11, 23465, 542, 8], 'id': 11}
2018-08-30 23:09:41 DEBUG (Thread-9) [miio.device] 192.168.1.89:54321 >>: {'id': 21, 'method': 'get_prop', 'params': ['power', 'bright', 'notifystatus', 'ambstatus', 'ambvalue', 'eyecare', 'scene_num', 'bls', 'dvalue']}
2018-08-30 23:09:41 DEBUG (Thread-3) [miio.device] 192.168.1.89:54321 >>: {'id': 22, 'method': 'get_prop', 'params': ['power', 'bright', 'notifystatus', 'ambstatus', 'ambvalue', 'eyecare', 'scene_num', 'bls', 'dvalue']}
2018-08-30 23:09:41 DEBUG (Thread-9) [miio.device] 192.168.1.89:54321 (ts: 1970-01-03 01:38:17, id: 21) << {'result': ['off', 40, 'off', 'on', 41, 'off', 1, 'on', 0], 'id': 21}
2018-08-30 23:09:41 DEBUG (MainThread) [homeassistant.components.light.xiaomi_miio] Got new state: <PhilipsEyecareStatus power=off, brightness=40, ambient=True, ambient_brightness=41, eyecare=False, scene=1, reminder=False, smart_night_light=True, delay_off_countdown=0>
2018-08-30 23:09:41 DEBUG (Thread-3) [miio.device] 192.168.1.89:54321 (ts: 1970-01-03 01:38:17, id: 22) << {'result': ['off', 40, 'off', 'on', 41, 'off', 1, 'on', 0], 'id': 22}
2018-08-30 23:09:41 DEBUG (MainThread) [homeassistant.components.light.xiaomi_miio] Got new state: <PhilipsEyecareStatus power=off, brightness=40, ambient=True, ambient_brightness=41, eyecare=False, scene=1, reminder=False, smart_night_light=True, delay_off_countdown=0>

IP address of my Philips lamp is 192.168.1.89 (see configuration above). I didn't remove messages from other Xiaomi devices from the log.

Thanks!

@miguelgilmartinez
Copy link

2018-10-07 12:16:32 DEBUG (Thread-15) [miio.philips_bulb] Count (5) of requested properties does not match the count (2) of received values.
2018-10-07 12:16:32 DEBUG (MainThread) [homeassistant.components.light.xiaomi_miio] Got new state:

It looks three parameters are not working: color_temperature=None, scene=None, delay_off_countdown=None

@syssi
Copy link
Member

syssi commented Oct 8, 2018

@miguelgilmartinez The Philips Eyecare Smart Lamp shouldn't respond as a "miio.philips_bulb". This implementation cannot work.

@miguelgilmartinez
Copy link

miguelgilmartinez commented Oct 8, 2018 via email

@syssi
Copy link
Member

syssi commented Oct 8, 2018

@miguelgilmartinez Could you provide some logs (debugging enabled)? Thanks in advance!

@miguelgilmartinez
Copy link

miguelgilmartinez commented Oct 9, 2018 via email

@syssi
Copy link
Member

syssi commented Oct 9, 2018

Could you provide the xiaomi_miio section of your configuration.yaml, too?

@balloob balloob mentioned this issue Oct 12, 2018
@miguelgilmartinez
Copy link

miguelgilmartinez commented Oct 13, 2018 via email

@syssi
Copy link
Member

syssi commented Oct 13, 2018

This is the problem. Your device model must be philips.light.sread1. The bulb is another kind of hardware.

@miguelgilmartinez
Copy link

miguelgilmartinez commented Oct 14, 2018 via email

@OleksandrBerchenko
Copy link
Contributor Author

Works fine in 0.80.0, thanks for the fix!

@miguelgilmartinez
Copy link

miguelgilmartinez commented Oct 14, 2018 via email

@syssi
Copy link
Member

syssi commented Oct 14, 2018

@miguelgilmartinez @OleksandrBerchenko is talking about this change: #17259

@OleksandrBerchenko
Copy link
Contributor Author

Well, it works, but there are still some issues with updating state: #17475

@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants