albertogeniola / meross-homeassistant

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

[MEROSS-API-CHANGED] Integration no longer loads - TypeError: HttpDeviceInfo.__init__() #412

Closed Raul-7-7 closed 1 year ago

Raul-7-7 commented 1 year ago

Describe the bug As of today (upgrading to 2022.12.9) the integration no logers loads with the error below. Tried restarting HA / reloading integration with no luck. Your environment HomeAssistant version: -- Home Assistant 2022.12.9 -- Hassio Version (if applicable): -- Operating System 9.4 -- Hardware environment: -- Intel i7 (Ubuntu) --

Logs taken when the issue happened

Error occurred. ------------------------------------- Component version: 0.4.5.0 Device info: <Unavailable> Error Message: "An exception occurred while setting up the meross manager. Setup will be retried..."
Traceback (most recent call last):
  File "/config/custom_components/meross_cloud/__init__.py", line 451, in async_setup_entry
    await meross_coordinator.initial_setup()
  File "/config/custom_components/meross_cloud/__init__.py", line 149, in initial_setup
    self._client, http_devices, creds_renewed = await get_or_renew_creds(
  File "/config/custom_components/meross_cloud/__init__.py", line 341, in get_or_renew_creds
    http_devices = await http_client.async_list_devices()
  File "/usr/local/lib/python3.10/site-packages/meross_iot/http_api.py", line 417, in async_list_devices
    return [HttpDeviceInfo.from_dict(x) for x in result]
  File "/usr/local/lib/python3.10/site-packages/meross_iot/http_api.py", line 417, in <listcomp>
    return [HttpDeviceInfo.from_dict(x) for x in result]
  File "/usr/local/lib/python3.10/site-packages/meross_iot/model/shared.py", line 27, in from_dict
    obj = cls(**new_dict)
TypeError: HttpDeviceInfo.__init__() missing 1 required positional argument: 'skill_number'
chrsc59 commented 1 year ago

Same here, failed during the night (Europe), was working yesterday evening

midadami commented 1 year ago

Same, everything was working fine until few hours ago. Same error.

dpacecca commented 1 year ago

I also have the same error, lost connectivity around 2hrs ago.

chrsc59 commented 1 year ago

restoring to core 2022.12.8 did not help, same error after HA reboot, or reload of the integration

btw, the Meross app (Android) works with the devices

varactor commented 1 year ago

Same issue here, it happened before any updates. Restarted HA, updated to latest core and still same issue.

Error same as original post.

Error Message: "An exception occurred while setting up the meross manager. Setup will be retried..." Traceback (most recent call last): File "/config/custom_components/meross_cloud/init.py", line 451, in async_setup_entry await meross_coordinator.initial_setup() File "/config/custom_components/meross_cloud/init.py", line 149, in initial_setup self._client, http_devices, creds_renewed = await get_or_renew_creds( File "/config/custom_components/meross_cloud/init.py", line 341, in get_or_renew_creds http_devices = await http_client.async_list_devices() File "/usr/local/lib/python3.10/site-packages/meross_iot/http_api.py", line 417, in async_list_devices return [HttpDeviceInfo.from_dict(x) for x in result] File "/usr/local/lib/python3.10/site-packages/meross_iot/http_api.py", line 417, in return [HttpDeviceInfo.from_dict(x) for x in result] File "/usr/local/lib/python3.10/site-packages/meross_iot/model/shared.py", line 27, in from_dict obj = cls(**new_dict) TypeError: HttpDeviceInfo.init() missing 1 required positional argument: 'skill_number'

dpacecca commented 1 year ago

I reloaded the integration an that did not work, I think the API address is down, iot.meross.com

chrsc59 commented 1 year ago

I reloaded the integration an that did not work, I think the API address is down, iot.meross.com

I'm presuming it is not down as the Meross app can control the devices from the cloud

Raul-7-7 commented 1 year ago

yeah, also the devices work with Google Home so the API seems fine.

Odinlistening commented 1 year ago

Confirming same issue here. All fine yesterday evening - no updates or system changes.

Raul-7-7 commented 1 year ago

Hmmm, since no change, then maybe Meross has changed something in the API payload?

komima commented 1 year ago

It may be the Meross api has changed, and no longer returns the skill_number field. Response is directly used to construct the device info class, and missing fields break the integration.

https://github.com/albertogeniola/MerossIot/blob/0.4.X.X/meross_iot/http_api.py#L417

For now I managed to resolve the issue by changing the meross_iot library model/http/device.py file manually (from homeassistant python environment, use python -c "import meross_iot.model.http.device as d; print(d.__file__) for file location), since that field seems not to be used anywhere important for homeassistant.

# skill_number: str, (for arg, comment out) self.skill_number = "123" (for assignment, just use anything)

albertogeniola commented 1 year ago

Hi all, yeah, Meross API changed. Tracking this issue here

--- EDIT --- I'm working on that as we speak. I've already patched the low-level library. Now I just need to wait for the testing pipeline to run and release the new MerossIot library. Then I need to release a new Meross Integration on HACS. It'll take a couple of hours in total. As soon as the new version is online, you'll need to upgrade the integration and restart your HA. I am sorry for the inconvenience, but as you can see, that's something we don't control...

albertogeniola commented 1 year ago

Hi all, the beta release that addresses this issue is ready to be tested (the lower-level library has been released right away). I need some volunteers to test it and report back if that solves the issue.

You can enable "beta releasaes" directly from HACS. You'll find a release named "Prerelease v1.2.7rc1": that is the one to be tested. Update your HA component, restart HA and please report back if that's working again. As soon as I get some confirmation, I'll proceed with producing the stable v1.2.7 release.

nao-pon commented 1 year ago

@albertogeniola Problem solved for me! thanks so much!

tomrush commented 1 year ago

@albertogeniola I have just updated and tested on my garage door opener. Everything looks to be working correctly on my simple setup. No errors or issues in the log.

Thanks for your prompt fix for this issue.

merlin-zaraza commented 1 year ago

@albertogeniola Works for me. Thanks!

albertogeniola commented 1 year ago

Thank you guys. I've released the v1.2.7 right away (it's exactly the same as 1.2.7rc1). We just need now to "spread the voice" to all people who are using this integration around the world.

I't just too bad Meross changes its API signature keeping the same api version number, which just break existing things. Also, this time we've been lucky: I'm currently on hollidays and I had my laptop with me, so I could fix this in a few hours.

Odinlistening commented 1 year ago

Thank you so much for incredible speed of response.

chrsc59 commented 1 year ago

Working now, Thanks !

Tristano67 commented 1 year ago

Hi ! I think it's my first comment on GitHub, but I really need to say THANK YOU !!! I'm using your Meross integration with some automations in my house, and you resolved this issue so fast ! BRAVO @albertogeniola and all people who worked on it

Phishing-Fish commented 1 year ago

Like what was previously stated, thank you so much for the quick response to address this issue. Your work is greatly appreciated.

davecowell commented 8 months ago

I am trying to update but HACS still shows 1.2.10 only and no update.

jasonwitty commented 2 weeks ago

I am trying to update but HACS still shows 1.2.10 only and no update.

try this: https://github.com/albertogeniola/meross-homeassistant/issues/510