albertogeniola / meross-homeassistant

Custom component that leverages the Meross IoT library to integrate with Homeassistant
MIT License
719 stars 82 forks source link

Integration does not show any devices or entities #401

Closed jcoupal closed 1 year ago

jcoupal commented 1 year ago

Describe the bug I downloaded and installed the meross cloud iot integration from HACS. Provided username/password (tested with wrong password, it failed on that), and the integration does not find the device (A meross MSS620, outdoor plug). The device is working and presents itself in the iPhone app.

Your environment HomeAssistant version: 2022.11.2 Hassio Version (if applicable): supervisor is 2022.10.2 (not sure if you wanted that) Hardware environment: Raspberry PI 4

Logs taken when the issue happened


Logger: homeassistant
Source: custom_components/meross_cloud/switch.py:93
Integration: Meross Cloud IoT
First occurred: 4:21:29 PM (2 occurrences)
Last logged: 4:25:54 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 151, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
    update_callback()
  File "/config/custom_components/meross_cloud/switch.py", line 93, in entity_adder_callback
    manager: MerossManager = hass.data[DOMAIN][MANAGER]  # type
KeyError: 'meross_cloud'
albertogeniola commented 1 year ago

Hi! I'm not sure there is support for MSS620 outdoor plug. In any case, can you please tell which version of the Meross-Homeassistant integration are you using? In case, it's not the latest, can you please update to v1.2.6 and test it again?

jcoupal commented 1 year ago

Hi, I am indeed using the v1.2.6 version. Here are the logs when the integration starts up:

This error originated from a custom integration.

Logger: custom_components.meross_cloud Source: custom_components/meross_cloud/init.py:451 Integration: Meross Cloud IoT First occurred: 11:58:22 AM (2 occurrences) Last logged: 12:00:16 PM

=============================== Meross Cloud Custom component Developed by Alberto Geniola Low level library version: 0.4.5.0 ------------------------------- 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: ===============================

albertogeniola commented 1 year ago

Hey @jcoupal , thanks for the info about the version. The log portion you posted is not relevant for debugging purposes: that's the initial "print" that the component always sends as soon as it completes the library loading. Instead the initial log entry you posted seems a bit weird... It's a long shoot, but I suspect you might have the following line in your configuration.yaml:

meross_cloud: 

If that's the case, remove that line and restart HomeAssistant: that should solve the issue.

jcoupal commented 1 year ago

I'm sorry, that's not evident in the configuration.yaml file. In the home_assistant.log file, however, I found this:

KeyError: 'meross_cloud' 2022-11-19 19:20:12.525 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 151, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners update_callback() File "/config/custom_components/meross_cloud/switch.py", line 93, in entity_adder_callback manager: MerossManager = hass.data[DOMAIN][MANAGER] # type

Not sure if it helps, but there you go. Full disclosure, I've pulled the Meross devices in via HomeKit integration, so the devices are working for me but I'm willing to assist you with debugging if you want to pursue it. If not, feel free to close this issue. Thank you very much!

albertogeniola commented 1 year ago

This error sounds really strange to me. There must be something odd here. Can you please remove the integration completely and restart HA? Then you should install the latest version available (1.2.8) and test again. Please attach the bootstrap logs so we can see which version of the component is loaded. Thanks!