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

msh300hk object has no attribute 'get_subdevice #400

Closed
sirhaplo opened this issue Nov 13, 2022 · 13 comments
Closed

msh300hk object has no attribute 'get_subdevice #400

sirhaplo opened this issue Nov 13, 2022 · 13 comments
Labels
Feature request no-stale waiting validation Waiting for user's test/validation

Comments

@sirhaplo
Copy link

I've bought a Meross MTS150 Kit, with a thermostat ( MTS150 ) and a hub ( MSH300HK ).
The integration see my hub, but no devices, and there isn't a hub device.

Here a piece of log that continue spawning on my logs :

2022-11-12 21:47:12.448 ERROR (MainThread) [meross_iot.manager] An unhandled exception occurred while handling push notification
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/meross_iot/manager.py", line 693, in _async_dispatch_push_notification
await dev.async_handle_push_notification(
File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/mixins/system.py", line 69, in async_handle_push_notification
parent_handled = await super().async_handle_push_notification(namespace=namespace, data=data)
File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/mixins/hub.py", line 175, in async_handle_push_notification
subdev = self.get_subdevice(subdevice_id=subdev_id)
AttributeError: 'msh300hk:4.0.0:4.5.22' object has no attribute 'get_subdevice'
2022-11-12 21:47:12.456 WARNING (MainThread) [meross_iot.manager] Uncaught push notification Namespace.HUB_MTS100_TEMPERATURE. Raw data: {"temperature": [{"room": 190, "id": "03004B52"}]}

and here the init logs :

2022-11-12 11:40:15.126 WARNING (MainThread) [custom_components.meross_cloud] Skip MQTT cert validation option set to: True
2022-11-12 11:40:18.795 WARNING (MainThread) [custom_components.meross_cloud]
===============================
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:
- Smart Hub (msh300hk) - OnlineStatus.ONLINE

There is something i can do ?
Are these devices supported ?

Thank you a lot for your work, it's really appreciated

@albertogeniola
Copy link
Owner

albertogeniola commented Nov 19, 2022

Hi @sirhaplo ,

after a bit of digging, I realized that your HUB version (MSH300HK) is the new "home-kit" hub version, which has not yet been tested with this integration and with its low-level python library. Unfortunately I do not own any homekit version of this HUB to test and develop support for.

I'll mark this thread as "feature required" for the moment. Hopefully we'll add support for this device in the near future.

In the meantime, you might be able to simply add this device via the home-kit support in HA.

@sirhaplo
Copy link
Author

Hi Alberto, i would like to help on this issue. Can you adress me on the fast way to make some test ? I have experience on python Dev and i could try to build up a pull request for the projects

@sirhaplo
Copy link
Author

sirhaplo commented Nov 26, 2022

Hi Alberto, i found in the merros-iot library documentation the section about sniffing data and i've done a brief scan of some commands from the device.
I attache here the data.zip results.

data.zip

I hope it will help.

Grazie
Daniele

@s1dave-web
Copy link

Ah I suspect this answers my issue also - I have the homekit hub.

Homekit integration did work and showed my MTS150 valves but I have a mix of MTS100/150 and the 100s didn't show.

Interestingly the Meross LAN add on worked using meross cloud integration - it found the hub and all mts150/100 valves!

I would like to see this integrated so will keep track so I can move to 1 integration in the future.

@albertogeniola
Copy link
Owner

Hi!
can you please provide a capture with the new version of meross_sniffer and provide the collected logs here?

@KiraPC
Copy link

KiraPC commented Jan 20, 2023

Hello @albertogeniola. I've also the new valve version with HK support and them are not displayed on HA.

Anyway, Homebridge support them, maybe you could look at this repo https://github.com/bwp91/homebridge-meross for reverse eng, maybe they use the same protocol.

Otherwise, let me know if I can help on integrate them.

EDIT: I found this error in HA logs Could not find any specific subdevice class for type mts150. Applying generic SubDevice class.

NB: I had to disable the plugin because my meross app was not working properly since I started your plugin, maybe for too much requests.

@sirhaplo
Copy link
Author

Hello @albertogeniola i did a new capture with new sniffer and new API.
I attache che zip file here :
data.zip

I did some activation, deactivation and temperature settings.

I hope this will help with your software.
Thanks so much

@github-actions github-actions bot added stale and removed stale labels Mar 14, 2023
@github-actions github-actions bot added stale and removed stale labels Apr 13, 2023
@ga11ego
Copy link

ga11ego commented Mar 1, 2024

Hi all.

First of all, @albertogeniola , thanks a lot for your hard work, it is very appreciated here.

I have bumped with the same error:

File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/chris/src/BalmesBot/balmes_lib.py", line 162, in ReadMeross
await dev.async_update()
File "/home/chris/.local/lib/python3.9/site-packages/meross_iot/controller/mixins/system.py", line 20, in async_update
await super().async_update(timeout=timeout, *args, **kwargs)
File "/home/chris/.local/lib/python3.9/site-packages/meross_iot/controller/mixins/hub.py", line 81, in async_update
target_device = self.get_subdevice(subdevice_id=dev_id)
AttributeError: 'msh300hk:4.0.0:5.5.32' object has no attribute 'get_subdevice'

Is there any way I could help to fix this?

@albertogeniola
Copy link
Owner

Hi @sirhaplo and @ga11ego,

I've released a new beta version, v1.3.2beta1. I believe this version addresses - among all - also the issue you reported.
Do you mind testing the new beta and provide feedbacks?

Thanks!

@albertogeniola albertogeniola added waiting validation Waiting for user's test/validation and removed Compatibility Report Reports device compatibility labels May 4, 2024
@ga11ego
Copy link

ga11ego commented May 6, 2024

Hi @albertogeniola ,

Thanks for your efforts. I will test it and report back to you as soon as possible.

@ga11ego
Copy link

ga11ego commented May 6, 2024

Hi @albertogeniola ,

Sorry if I ask something too easy, but I'm a bit confused. I was not ussing homeassistant, but only meross-iot.

The piece of code is this:

http_api_client = await MerossHttpClient.async_from_user_password(api_base_url='https://iotx-eu.meross.com',
                                                                  email=EMAIL, 
                                                                  password=PASSWORD)
manager = MerossManager(http_client=http_api_client)
await manager.async_init()

# Retrieve all the MS100 devices that are registered on this account
await manager.async_device_discovery()
sensors = manager.find_devices(device_type="msh300hk")

if len(sensors) < 1:
    print("No msh300hk plugs found...")
else:
    dev = sensors[0]
    await dev.async_update()
    temp = dev.last_sampled_temperature
    humid = dev.last_sampled_humidity
    time = dev.last_sampled_time
    print(f"Current sampled data on {time.isoformat()}; Temperature={temp}°C, Humidity={humid}%")
manager.close()
await http_api_client.async_logout()

So i don't know how to install or manage the meross-homeassistant (i am on a RaspBerry Pi) I have read the readme.md doc but can't figure out what to do.

@albertogeniola
Copy link
Owner

Hi @ga11ego ,
this repository is about the HomeAssistant component. You should have opened the ticket on the MerossIot repository instead. In any case, I believe you just need to upgrade the MerossIot library to v0.4.7.2b3:

pip install meross_iot==0.4.7.2b3

Then you should be able to see the subdevices attached to the MSH300HK hub.

@ga11ego
Copy link

ga11ego commented May 7, 2024

Hi @albertogeniola ,

Thanks a lot for your patience. Now I realise I posted the error in the wrong repository. Sorry for that.

Best regards,
Christian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request no-stale waiting validation Waiting for user's test/validation
Projects
None yet
Development

No branches or pull requests

5 participants