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

Errors with mdl110m lamp, wrong state? #448

Closed
mguilherme opened this issue Jun 14, 2023 · 7 comments
Closed

Errors with mdl110m lamp, wrong state? #448

mguilherme opened this issue Jun 14, 2023 · 7 comments

Comments

@mguilherme
Copy link
Contributor

mguilherme commented Jun 14, 2023

Describe the bug
I have this mdl110m lamp from Meross integrated with HA, the problem is when I turn on on the UI, the switch automatically turns off but the lamp stays on.
I'm not sure if the errors on the log are related

Your environment
HomeAssistant version: 2023.6.1
Hassio Version (if applicable): -- PLEASE SPECIFY --
Hardware environment: Home Assistant OS VM using the official KVM (qcow2) on a Proxmox

Logs taken when the issue happened

===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.5.7
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here: 
https://github.com/albertogeniola/meross-homeassistant/issues

If you like this extension and you want to support it, please consider donating.
-------------------------------
List of devices reported by HTTP API:
- Garage Ceiling Light (msl120dr) - OnlineStatus.ONLINE
- Office Lamp (mdl110m) - OnlineStatus.ONLINE
- Office Plug (mss210) - OnlineStatus.ONLINE
- Hall Ambient Light (msl430) - OnlineStatus.ONLINE
- Camera Plug (mss210) - OnlineStatus.ONLINE
- Box Opener (msg100) - OnlineStatus.ONLINE
===============================
2023-06-14 15:26:05.736 WARNING (MainThread) [meross_iot.manager] Found a new device Garage Ceiling Light (msl120dr, HW 4.0.0, FW 4.2.4, class: msl120dr:4.0.0:4.2.4) that has become online while we were offline.
2023-06-14 15:26:05.739 WARNING (MainThread) [meross_iot.manager] Found a new device Office Lamp (mdl110m, HW 4.0.0, FW 4.2.3, class: mdl110m:4.0.0:4.2.3) that has become online while we were offline.
2023-06-14 15:26:05.740 WARNING (MainThread) [meross_iot.manager] Found a new device Hall Ambient Light (msl430, HW 4.0.0, FW 4.2.6, class: msl430:4.0.0:4.2.6) that has become online while we were offline.
2023-06-14 15:26:05.742 WARNING (MainThread) [meross_iot.manager] Found a new device Office Plug (mss210, HW 4.0.0, FW 4.2.9, class: mss210:4.0.0:4.2.9) that has become online while we were offline.
2023-06-14 15:26:05.743 WARNING (MainThread) [meross_iot.manager] Found a new device Camera Plug (mss210, HW 4.0.0, FW 4.2.9, class: mss210:4.0.0:4.2.9) that has become online while we were offline.
2023-06-14 15:26:05.744 WARNING (MainThread) [meross_iot.manager] Found a new device Box Opener (msg100, HW 4.0.0, FW 4.2.6, class: msg100:4.0.0:4.2.6) that has become online while we were offline.
2023-06-14 15:27:08.502 ERROR (MainThread) [meross_iot.controller.device] Error occurred while firing push notification event Namespace.CONTROL_TOGGLEX with data: {'togglex': [{'onoff': 1, 'lmTime': 1686752827, 'channel': 0}]}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/meross_iot/controller/device.py", line 144, in _fire_push_notification_event
    await c(namespace=namespace, data=data, device_internal_id=device_internal_id)
  File "/config/custom_components/meross_cloud/__init__.py", line 310, in _async_push_notification_received
    self.async_schedule_update_ha_state(force_refresh=full_update)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in async_schedule_update_ha_state
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 656, in _async_write_ha_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 998, in state_attributes
    color_mode = self._light_internal_color_mode
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 829, in _light_internal_color_mode
    if ColorMode.HS in supported and self.hs_color is not None:
                                     ^^^^^^^^^^^^^
  File "/config/custom_components/meross_cloud/light.py", line 100, in hs_color
    return color_util.color_RGB_to_hs(*rgb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.util.color.color_RGB_to_hs() argument after * must be an iterable, not NoneType
2023-06-14 15:28:05.613 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
    update_callback()
  File "/config/custom_components/meross_cloud/__init__.py", line 254, in _http_data_changed
    self.async_schedule_update_ha_state(force_refresh=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in async_schedule_update_ha_state
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 656, in _async_write_ha_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 998, in state_attributes
    color_mode = self._light_internal_color_mode
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 829, in _light_internal_color_mode
    if ColorMode.HS in supported and self.hs_color is not None:
                                     ^^^^^^^^^^^^^
  File "/config/custom_components/meross_cloud/light.py", line 100, in hs_color
    return color_util.color_RGB_to_hs(*rgb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.util.color.color_RGB_to_hs() argument after * must be an iterable, not NoneType
2023-06-14 15:29:26.551 ERROR (MainThread) [meross_iot.controller.device] Error occurred while firing push notification event Namespace.CONTROL_TOGGLEX with data: {'togglex': [{'onoff': 1, 'lmTime': 1686752965, 'channel': 0}]}
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/meross_iot/controller/device.py", line 144, in _fire_push_notification_event
    await c(namespace=namespace, data=data, device_internal_id=device_internal_id)
  File "/config/custom_components/meross_cloud/__init__.py", line 310, in _async_push_notification_received
    self.async_schedule_update_ha_state(force_refresh=full_update)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in async_schedule_update_ha_state
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 656, in _async_write_ha_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 998, in state_attributes
    color_mode = self._light_internal_color_mode
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 829, in _light_internal_color_mode
    if ColorMode.HS in supported and self.hs_color is not None:
                                     ^^^^^^^^^^^^^
  File "/config/custom_components/meross_cloud/light.py", line 100, in hs_color
    return color_util.color_RGB_to_hs(*rgb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.util.color.color_RGB_to_hs() argument after * must be an iterable, not NoneType
2023-06-14 15:30:05.646 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
    update_callback()
  File "/config/custom_components/meross_cloud/__init__.py", line 254, in _http_data_changed
    self.async_schedule_update_ha_state(force_refresh=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in async_schedule_update_ha_state
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 656, in _async_write_ha_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 998, in state_attributes
    color_mode = self._light_internal_color_mode
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 829, in _light_internal_color_mode
    if ColorMode.HS in supported and self.hs_color is not None:
                                     ^^^^^^^^^^^^^
  File "/config/custom_components/meross_cloud/light.py", line 100, in hs_color
    return color_util.color_RGB_to_hs(*rgb)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.util.color.color_RGB_to_hs() argument after * must be an iterable, not NoneType

@mguilherme
Copy link
Contributor Author

mguilherme commented Jun 14, 2023

From a quick question to chatgpt I got this answer:

From the log messages you shared, it appears the issue is with the handling of the hue-saturation (HS) color model in the Meross custom component.

The error message TypeError: homeassistant.util.color.color_RGB_to_hs() argument after * must be an iterable, not NoneType indicates that the component is trying to convert a None value to HS color space, which is causing the error. This could be a bug in the component itself.

Here are a few steps you could try:

  1. Check for Updates: The first step is to check if there's an update available for the Meross custom component that you're using. The developer might have already fixed this issue in a newer version.

  2. Change Light Settings: If your light supports different color modes, try setting it to a different mode, or turning off color modes altogether if you don't need them. The issue seems to be specifically related to handling color values.

  3. Reach Out to Developer: If you're still having issues, the best course of action might be to reach out to the developer directly. The log messages you shared include a link to the GitHub issues page for the component: https://github.com/albertogeniola/meross-homeassistant/issues. You can open a new issue there, include the error messages you're seeing, and ask for help. The developer or other users might be able to provide more specific guidance.

Remember to provide as much detail as possible when reporting the issue, including the exact models of the Meross devices you're using, the version of the component and Home Assistant, and any other relevant information.

@mguilherme
Copy link
Contributor Author

I'm not even sure how to put this in white only, there's no way to do that in homekit or the meross app

@mguilherme
Copy link
Contributor Author

TypeError: homeassistant.util.color.color_RGB_to_hs() argument after * must be an iterable, not NoneType

It seems that this lamp doesn't support RGB, only color temperature.

This error seems to indicate that the RGB value the integration is trying to convert is None—in other words, the integration doesn't know the current RGB color of the light.

@mguilherme
Copy link
Contributor Author

It seems to be in this method:

It first checks if the device supports light color. If it does, it attempts to get the RGB color and then convert it to an HS color. This is where the error occurs because this device does not support RGB color, but the method supports_light_color() seems to return True.

@mguilherme
Copy link
Contributor Author

mguilherme commented Jun 14, 2023

please take a look at the PR I created: #449

@mguilherme
Copy link
Contributor Author

mguilherme commented Jun 28, 2023

Any news on this?
Is this project still maintained? @albertogeniola ?

@albertogeniola
Copy link
Owner

Hi!
Done, thanks a lot for your help and contribution. PR has been merged.

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

No branches or pull requests

2 participants