Closed Write closed 6 months ago
Hello @Write , This issue is really persistent! One thing I notice is the newer device (hw 6.0.0) does not have the timezone set. I cannot say it is for sure the reason but you could try set it the same as the older hw version ones ('Europe/Paris'). To be honest, if I remember it right, it was not necessary for hw 2.0.0 to have this configuration set in order to work but maybe newer fw has an issue with that.
Also, it looks like their MQTT binding is different. If the traces were taken at the same time i.e. without rebooting HA, they're showing different values for the MQTT bind server/port/userId (the obfuscation algorithm would match the same server name to the same obfuscated value) but this is just a question for me to understand the 'context' in which these trace were done.
All in all, one point for investigating this issue is the fact that when the devices boot up and connect to the (private) broker, they're expecting a particular warm-up sequence which has been implemented in latest meross_lan (4.5.2 has it in place) but the meaning and real behavior of this sequence is a bit obscure at the moment (see #346). In details, the mss devices send a kind of 'configuration payload' to the server and expect a response for this. Now, the actual implementation for the content of this response is to just reply the same payload the device sent to the broker but it could be wrong since the test/implementation was done with an mss315 device
In order to better investigate this warm-up sequence, actual meross_lan version lacks the needed debugging facilities (initial warm-up is not beeing logged) while the actual 'dev' branch has better support for this. The only option to see what happens when the device boots and connect to the HA broker would be to use the 'sniff' feature of the HA MQTT component and watch all the packets sent to the wildcard topic /appliance/#
I'll follow up with a (working?) pre-release in order to have the option to better log the boot sequence and try to understand what's going on
Thanks for your fast answer.
Hello @Write , This issue is really persistent! One thing I notice is the newer device (hw 6.0.0) does not have the timezone set. I cannot say it is for sure the reason but you could try set it the same as the older hw version ones ('Europe/Paris').
I actually have no idea how to set a specific timezone on a device.
Also, it looks like their MQTT binding is different. If the traces were taken at the same time i.e. without rebooting HA, they're showing different values for the MQTT bind server/port/userId (the obfuscation algorithm would match the same server name to the same obfuscated value) but this is just a question for me to understand the 'context' in which these trace were done.
Okay, maybe I made a mistake and it is possible that this specific MSS310 is still binded to Meross Cloud, as I feared to loose my readings history inside HA. Ofc, it can't access Meross cloud in any way. I unfortunatly can't remember if I rebooted HA between those two tries as I figured how to get trace logs at first, one sure thing is that it was done in the same ten minute bracket.
In order to better investigate this warm-up sequence, actual meross_lan version lacks the needed debugging facilities (initial warm-up is not beeing logged) while the actual 'dev' branch has better support for this. The only option to see what happens when the device boots and connect to the HA broker would be to use the 'sniff' feature of the HA MQTT component and watch all the packets sent to the wildcard topic /appliance/#
I'd be happy to give you any logs you would need if I'm given required to sniff MQTT packets.
I'll follow up with a (working?) pre-release in order to have the option to better log the boot sequence and try to understand what's going on.
Well thanks a lot, I'll hapilly try a pre-release as soon as available to give you the logs.
On my MS315 I also had zero values for the monitoring until I set the time zone correctly.
On my MS315 I also had zero values for the monitoring until I set the time zone correctly.
Nice to know!
@Write, you can set the timezone in meross_lan
by entering the configuration UI for the device and select from the list of system timezones
On my MS315 I also had zero values for the monitoring until I set the time zone correctly.
Nice to know! @Write, you can set the timezone in
meross_lan
by entering the configuration UI for the device and select from the list of system timezones
Hmm. I'm using HTTP maybe that why there's no such option.
I never managed to be able to connect to the MQTT broker trough meross_lan, hence why I'm using just HTTP method
Yes, it is available only when the devices are 'fully' locally paired
Hmm.. okay this one is tricky. I can't really add the meross to the MQTT server that HA connect to as it had some requirements with certs and such, I have a docker container with a mosquitto instance just for the meross. I know there is a workaround that required to create an HA user for each meross devices but I just didn't want to do that.
Some years ago when I've integrated my devices I've followed this procedure to bypass the need for authentication
Hmm.. okay this one is tricky. I can't really add the meross to the MQTT server that HA connect to as it had some requirements with certs and such, I have a docker container with a mosquitto instance just for the meross. I know there is a workaround that required to create an HA user for each meross devices but I just didn't want to do that.
I suggested some solutions in another ticket here related to the MSS315 devices and connecting to HAs built in MQTT server (can't easily grab it as I'm on mobile).
I'm using one of those solutions without affecting the overall configuration of HA and Mosquitto, and have my Meross devices fully locally paired.
Ultimately, I set up an Mosquitto listener with RSA-key based certs (Meross devices don't support EC ones), paired the devices to my LAN using Matter or the Meross app (if you're using non Matter devices) then used the Meross command line tool I found in another repo to redirect them at my Mosquitto broker after setting up a user account in HA for each device based in the user/pass the tool provides for each device when they're queried; then reconfigured Meross LAN for each device to MQTT and set the time zone, now they're fully local and support monitoring.
Sorry not to cite the proper sources, happy to grab them later if it helps when I'm at my PC.
Hmm.. okay this one is tricky. I can't really add the meross to the MQTT server that HA connect to as it had some requirements with certs and such, I have a docker container with a mosquitto instance just for the meross. I know there is a workaround that required to create an HA user for each meross devices but I just didn't want to do that.
I suggested some solutions in another ticket here related to the MSS315 devices and connecting to HAs built in MQTT server (can't easily grab it as I'm on mobile).
I'm using one of those solutions without affecting the overall configuration of HA and Mosquitto, and have my Meross devices fully locally paired.
Ultimately, I set up an Mosquitto listener with RSA-key based certs (Meross devices don't support EC ones), paired the devices to my LAN using Matter or the Meross app (if you're using non Matter devices) then used the Meross command line tool I found in another repo to redirect them at my Mosquitto broker after setting up a user account in HA for each device based in the user/pass the tool provides for each device when they're queried; then reconfigured Meross LAN for each device to MQTT and set the time zone, now they're fully local and support monitoring.
Sorry not to cite the proper sources, happy to grab them later if it helps when I'm at my PC.
Yeah I have the same setup, just that they are locally paired to an independant MQTT Broker that is not the HA one as I didn't wanted to create an HA user for each devices. I think I'll switch all other device to this broker, and then connect HA to IT. I wasn't aware of "per_listener_settings" for Mosquitto in @krahabb link, and that should ease the burden for me.
Yeah the per listener settings are the key.
It sounds like between us we should have solutions that work for everyone. I have no issue adding users for each device to HA, they're separate from "people" and I already have a bunch of accounts for other "robot" and device related things so it doesn't really pollute HA for me; also the credentials of the Meross devices are fixed, based on MAC, so being able to back it up with HA is a plus for me.
Hope you get it working the way you want!
Yeah the per listener settings are the key.
It sounds like between us we should have solutions that work for everyone. I have no issue adding users for each device to HA, they're separate from "people" and I already have a bunch of accounts for other "robot" and device related things so it doesn't really pollute HA for me; also the credentials of the Meross devices are fixed, based on MAC, so being able to back it up with HA is a plus for me.
Hope you get it working the way you want!
The fact that it's separate from people is interesting. I tought it was a new real user each time, Maybe i'll try to hook it up to HA directly then.
Yeah the per listener settings are the key.
It sounds like between us we should have solutions that work for everyone. I have no issue adding users for each device to HA, they're separate from "people" and I already have a bunch of accounts for other "robot" and device related things so it doesn't really pollute HA for me; also the credentials of the Meross devices are fixed, based on MAC, so being able to back it up with HA is a plus for me.
Hope you get it working the way you want!
The fact that it's separate from people is interesting. I tought it was a new real user each time, Maybe i'll try to hook it up to HA directly then.
Indeed, if you go to People" in settings there's two tabs, "People" and "Users", I have two people, my wife and myself, but I have 30+ "users", it's really quite tidy.
Well thanks to both of you I managed to correctly setup HA MQTT with the "new user" method, and could setup the correct Timezone and it works perfectly now !
My mom as a different setup, as it's not running HA OS, I was forced to use the manual "Mosquitto in Docker method" with per_listener_settings so HA could easily connect to Mosquitto broker.
So basically, I know how to setup it correctly both with the "fully manual method" and with an HA User, so it's nice.
That's awesome. I'll think about 'porting' the timezone-set feature to be available also to HTTP paired devices since the choice to make it only available to local MQTT binded ones was like a 'precautionary' one due to the fact that Meross binded devices already have the option to be fully configured from the app (so duplicating the feature isn't necessary)
The 'hidden' problem is the fact that in order to correctly and fully configure the timezone meross_lan
needs to send the correct timezone DST changes to the device and meross_lan
is actually only able to correctly setup this infos when the python pytz
library is available in the system. If not, meross_lan
will 'gracefully' discard the issue and just try a best-effort approach in configuring the DST changes
The new 'Moonlight' release will have the timezone configuration available for every type of device pairing mode and some other helping features to cope with this:
Similar to : https://github.com/krahabb/meross_lan/issues/300 This issue has been marked as fixed in https://github.com/krahabb/meross_lan/pull/337 but it's not, or at least not for 310 w/ HW 6.0.0 and update >= 6.3.21
Version of the custom_component
v4.5.2
Describe the bug
I have 4 MSS310 (Hardware 2.0.0), w/ update 2.1.17 which works perfectly fine since forever.
I just bought 3 new MSS310 (Hardware 6.0.0) with update 6.3.21
On which I can only on/off the outlet and the DNDmode, but I got no data from the consumption : no current value no energy value no power value no voltage value
I have an OPNsense router.
Back then, for readings to works correctly on my MSS310 (2.0.0), I had to add a rule to forward all NTP requests going outside to be forwarded on my local NTP server, since I have blocked internet access, so they could correctly set their own time.
Now, once I received my new MSS310, I have done the same, and with the helps of OPNsense logging, I can confirm that I DO receive NTP requests from those new MSS310 (6.0.0), and they are correctly forwarded to my local NTP server, exactly as the MSS310 (2.0.0).
Note : All my devices are paired with https://github.com/bytespider/Meross, w/ an empty key. Resetting and repairing an "older" MSS310 (2.0.0) still work perfectly, and readings are still fine after re-adding them to HA.
Debug log
Trace logs for an MSS310 w/ Hardware 6.0.0, unused
Trace logs for an MSS310 w/ Hardware 2.0.0 connected to the same power strip, unused