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

Sun component + Yeelight Broken #17485

Closed
rocksolid2018 opened this issue Oct 15, 2018 · 10 comments
Closed

Sun component + Yeelight Broken #17485

rocksolid2018 opened this issue Oct 15, 2018 · 10 comments

Comments

@rocksolid2018
Copy link

rocksolid2018 commented Oct 15, 2018

Home Assistant release with the issue:
0.80.0

  • Frontend -> Developer tools -> Info
  • Or use this command: hass --version
    -->

Last working Home Assistant release (if known):
0.79.0

Operating environment (Hass.io/Docker/Windows/etc.):
Docker
Please provide details about your environment.
-->
hassio on docker, ubuntu 18, NUC
Component/platform:

https://www.home-assistant.io/components/sun/

Description of problem:

Sun automation doesn't trigger yeelight bulbs at sunset. getting service exception error

Error executing service <ServiceCall light.turn_on (c:a9b27a29456349abbf39f8302db9e8ff): entity_id=['light.yeelight_rgb_f0b429b72ee7', 'light.yeelight_rgb_f0b429b838ac', 'light.coridoor', 'light.yeelight_rgb_286c07108809']>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/xiaomi_miio.py", line 261, in _try_command
    partial(func, *args, **kwargs))
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/miio/philips_bulb.py", line 96, in on
    return self.send("set_power", ["on"])
  File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 270, in send
    raise DeviceError(m.data.value["error"])
miio.exceptions.DeviceError: {'code': -30001, 'message': 'Resp invalid json.'}

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

  - alias: 'Sunset Lights on'
    initial_state: True
    trigger:
      - platform: sun
        event: sunset
    action:
      - service: light.turn_on
        entity_id:
          - light.yeelight_rgb_f0b429b72ee7
          - light.yeelight_rgb_f0b429b838ac

Traceback (if applicable):

File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/__init__.py", line 270, in async_handle_light_on_service
    await light.async_turn_on(**pars)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/xiaomi_miio.py", line 472, in async_turn_on
    "Turning the light on failed.", self._light.on)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/xiaomi_miio.py", line 267, in _try_command
    _LOGGER.error(mask_error, exc)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1336, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1443, in _log
    self.handle(record)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1453, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1515, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 864, in handle
    self.emit(record)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/system_log/__init__.py", line 130, in emit
    entry = self._create_entry(record, stack)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/system_log/__init__.py", line 113, in _create_entry
    'message': record.getMessage(),
  File "/usr/local/lib/python3.6/logging/__init__.py", line 338, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting

Additional information:

@kennedyshead
Copy link
Contributor

This is an error in xiaomi_miio and not sun as far as this stacktrace goes.

@rocksolid2018
Copy link
Author

This is an error in xiaomi_miio and not sun as far as this stacktrace goes.

I guess, your right, I now see all automations are failing with yeelights. how do we fix the error?

@kennedyshead
Copy link
Contributor

I can maybee help but I have no device to test this on. If you test Ill give it a go.

@rocksolid2018
Copy link
Author

Sure, lets do it. I find my home in darkness when i return late from work :(

@kennedyshead
Copy link
Contributor

Oh!.. Well Im looking into it now.

@kennedyshead
Copy link
Contributor

There have been some changes to the component in 0.80 could you try to upgrade and take a look if its solved?

@rocksolid2018
Copy link
Author

rocksolid2018 commented Oct 22, 2018 via email

@rocksolid2018
Copy link
Author

updated to 0.81.0 no go. same issue

@syssi
Copy link
Member

syssi commented Nov 16, 2018

Your automation controls 4 devices:

Error executing service <ServiceCall light.turn_on (c:a9b27a29456349abbf39f8302db9e8ff): entity_id=['light.yeelight_rgb_f0b429b72ee7', 'light.yeelight_rgb_f0b429b838ac', 'light.coridoor', 'light.yeelight_rgb_286c07108809']>

It looks like the light.coridoor is a Xiaomi Philips Bulb, correct? This traceback is about a "turn on" of a "light.xiaomi_miio" (the bulb?)

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/light/xiaomi_miio.py", line 261, in _try_command
    partial(func, *args, **kwargs))
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/miio/philips_bulb.py", line 96, in on
    return self.send("set_power", ["on"])
  File "/usr/local/lib/python3.6/site-packages/miio/device.py", line 270, in send
    raise DeviceError(m.data.value["error"])
miio.exceptions.DeviceError: {'code': -30001, 'message': 'Resp invalid json.'}

It's a known bug of the Philips bulb which happens some times and isn't handled properly right now: rytilahti/python-miio#205

@syssi syssi self-assigned this Nov 16, 2018
@syssi
Copy link
Member

syssi commented Jan 7, 2019

This bug will be fixed soon by rytilahti/python-miio#449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants