albertogeniola / MerossIot

Async Python library for controlling Meross devices
https://albertogeniola.github.io/MerossIot/
MIT License
477 stars 88 forks source link

hourly consumption MSS310 #362

Closed MaierJuerg closed 2 months ago

MaierJuerg commented 6 months ago

With the Meross App for Android when I request the status of the switch I get multiple options for the date range to be shown in the graph. So far I can only get the last months daily totals with await dev.async_get_instant_metrics() Is there a way to query hourly totals for a day?

cbreezier commented 6 months ago

This library currently supports fetching the total consumption in kWh for a full day. This is equivalent to the data you see in the "Week" tab.

You've been looking at async_get_instant_metrics() which is part of ElectricityMixin. MSS310 also supports ConsumptionXMixin which allows you to fetch consumption data.

You can use await dev.async_get_daily_power_consumption() to get this data. Just a note - it looks like the library author may change the return type in the near future. There's a TODO that reads: # TODO: returning a nice PowerConsumtpionReport object rather than a list of dict?

I'm not sure how to retrieve hourly data. I can see that the MSS310 also advertises that it supports the Appliance.Control.ConsumptionH ability, but this library doesn't support that ability yet. Perhaps that's the API for hourly consumption data?

We'd have to use the sniffer to get a better idea of how the hourly consumption data can be read.

MaierJuerg commented 6 months ago

Thanks for Your reply. The Main Issue at the Moment however is that the iox-EU.MEROSS.COM is giving a 404 error disabling any control of the mss310 devices. Meross support states that they havent changed anything with their server setup, which can not be true. I personally think the only solution is to avoid this propriatary cloud bullshit and have a own mqtt server set up with tomcat Devices . Burn these meross devices! Juergl

Leo Huang @.***> schrieb am Mi., 20. März 2024, 12:28:

This library currently supports fetching the total consumption in kWh for a full day. This is equivalent to the data you see in the "Week" tab.

You've been looking at async_get_instant_metrics() which is part of ElectricityMixin. MSS310 also supports ConsumptionXMixin which allows you to fetch consumption data.

You can use await dev.async_get_daily_power_consumption() to get this data. Just a note - it looks like the library author may change the return type in the near future. There's a TODO that reads: # TODO: returning a nice PowerConsumtpionReport object rather than a list of dict?

I'm not sure how to retrieve hourly data. I can see that the MSS310 also advertises that it supports the Appliance.Control.ConsumptionH ability, but this library doesn't support that ability yet. Perhaps that's the API for hourly consumption data?

We'd have to use the sniffer to get a better idea of how the hourly consumption data can be read.

— Reply to this email directly, view it on GitHub https://github.com/albertogeniola/MerossIot/issues/362#issuecomment-2009350363, or unsubscribe https://github.com/notifications/unsubscribe-auth/BGXJ63JHKRG3YYSYPTC7ZVDYZFXGJAVCNFSM6AAAAABEIZD2HOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBZGM2TAMZWGM . You are receiving this because you authored the thread.Message ID: @.***>

cbreezier commented 6 months ago

Agreed that a pure-local setup would be much nicer :)

The good news is that the library maintainer has some (experimental) code that does allow for a fully local setup, it seems. So that might be worth looking into for you.

Re: 404 from iox-eu.meross.com: I'm in Australia but when I try and use iotx-ap.meross.com, I actually get redirected to iotx-us.meross.com. Perhaps you could try the US subdomain as well? Also, are you trying iox or iotx in the subdomain?

MaierJuerg commented 4 months ago

I had raised a connection issue in the project. Alberto pointed me to the latest update of the library and after applying that, I was able to connect again to iox-eu.meross.com

MaierJuerg commented 4 months ago

In the app when refreshing the device data I also get a "daily consumption" shown. however querying the historical data the current date is not included. If I somehow could query the current daily total I could simply run that query once every hour for the devices I would like to record hourly values (my solar pads). In that case I would not need a query for the hourly values of a given date.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.