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

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

Closed
Raul-7-7 opened this issue Jan 4, 2023 · 22 comments
Assignees
Labels
bug Something isn't working Critical The bug is disruptive and requires immediate fix

Comments

@Raul-7-7
Copy link

Raul-7-7 commented Jan 4, 2023

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
Copy link

chrsc59 commented Jan 4, 2023

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

@midadami
Copy link

midadami commented Jan 4, 2023

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

@dpacecca
Copy link

dpacecca commented Jan 4, 2023

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

@chrsc59
Copy link

chrsc59 commented Jan 4, 2023

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
Copy link

varactor commented Jan 4, 2023

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
Copy link

dpacecca commented Jan 4, 2023

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

@chrsc59
Copy link

chrsc59 commented Jan 4, 2023

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
Copy link
Author

Raul-7-7 commented Jan 4, 2023

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

@Odinlistening
Copy link

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

@Raul-7-7
Copy link
Author

Raul-7-7 commented Jan 4, 2023

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

@komima
Copy link

komima commented Jan 4, 2023

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
Copy link
Owner

albertogeniola commented Jan 4, 2023

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 albertogeniola added bug Something isn't working Critical The bug is disruptive and requires immediate fix labels Jan 4, 2023
@albertogeniola albertogeniola changed the title Integration no longer loads - TypeError: HttpDeviceInfo.__init__() [MEROSS-API-CHANGED] Integration no longer loads - TypeError: HttpDeviceInfo.__init__() Jan 4, 2023
@albertogeniola albertogeniola self-assigned this Jan 4, 2023
@albertogeniola albertogeniola pinned this issue Jan 4, 2023
@albertogeniola
Copy link
Owner

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
Copy link

nao-pon commented Jan 4, 2023

@albertogeniola Problem solved for me! thanks so much!

@tomrush
Copy link

tomrush commented Jan 4, 2023

@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
Copy link

@albertogeniola Works for me. Thanks!

@albertogeniola
Copy link
Owner

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
Copy link

Thank you so much for incredible speed of response.

@chrsc59
Copy link

chrsc59 commented Jan 4, 2023

Working now, Thanks !

@Tristano67
Copy link

Tristano67 commented Jan 4, 2023

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
Copy link

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

@davecowell
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Critical The bug is disruptive and requires immediate fix
Projects
None yet
Development

No branches or pull requests