krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
418 stars 45 forks source link

Meross Smart Switch (mss310, mss315, mss-any) power and energy readings failure #300

Closed PhilippeRaven closed 10 months ago

PhilippeRaven commented 1 year ago

Version of the custom_component

v4.2.0

Configuration

3x MSS310 with 6.1.10 firmware 1x MSS310 with 6.3.21 firmware

Describe the bug

I upgraded the custom_component from 2.6.2 to 4.2.0 to be sure it will work with the new MSS310 I just bought, with firmware 6.3.21. So currently in 4.2.0, everything is still working perfectly for the 3 MSS310 with 6.1.10, BUT for the one with 6.3.21, I can on/off the outlet and the DNDmode, but I got no data from the consumption :

I'm using the MQTT way.

Debug log

Currently no logs. I'll try tonight to see a difference in MQTT messages between the 3 working and the one not working.

PhilippeRaven commented 1 year ago

Well, suddenly today, since 7:48AM, I got values. I don't understand how and why it was not working before, but it works now. I hope it'll keep working.

krahabb commented 1 year ago

If I'm not wrong, I remember the consumption readings where 'off' (on my older 2.0.0 fw) when the plug was not able to sync it's time. Maybe this could explain this a bit. meross_lan has a sort of time sync procedure in place with 'cooperative' devices (my mss310 on fw 2.0.0 where...) and should be able to get the device going. The time-sync procedure usually starts at boot with the device asking for a proper time setting reply through the MQTT broker (and meross_lan or whatever software stack is at the other end)

PhilippeRaven commented 1 year ago

Hi krahabb, thanks for the reply. But what could prevent the plug to sync his time (apart from not getting internet access because the preconfigured ntp is on the internet). BTW from which ntpd it got his time ? I've got my own internal ntpd, so if it was possible to configure a specific ntpd like it's possible with the MQTT parameters, that'd be great !

krahabb commented 1 year ago

That's not possible as far as I know... what you could do is to 'proxy' the ntp requests going to the internet by using a private dns configured on the router for your LAN devices and instruct this private DNS server to map the requests going to the outside NTP server names to the IP of your private NTP - which I guess would be the router itself. At the moment I don't know which 'public' NTPs are searched for by the Meross devices but that could be easily spotted by sniffing your LAN. Here a better explanation of the scenario

krahabb commented 10 months ago

Reopening in order to collect various issues (#312, #318) about the same underlying problem

Write commented 10 months ago

I also have a mss310 6.0.0, with Firmware 6.3.21, latest Alpha .1 doesn't fix the issue.

I have paired mine with a local Mosquitto MQTT Broker and add my MSS310 without device key via the IP + HTTP API (Not sure how to connect via the MQTT one).

All value shows as 0, whereas my older mss310 2.0.0 with firmware 2.1.17 report everything just fine.

Furthermore, I forward all NTP (Port 123) request going outside to my local NTP server.

I'm not sure how to set the "TimeZone" (as seen here : "configure the MSS310 as MQTT and with TZ in meross_lan" : https://github.com/krahabb/meross_lan/issues/318#issuecomment-1723387029 ).

fuomag9 commented 9 months ago

That's not possible as far as I know... what you could do is to 'proxy' the ntp requests going to the internet by using a private dns configured on the router for your LAN devices and instruct this private DNS server to map the requests going to the outside NTP server names to the IP of your private NTP - which I guess would be the router itself. At the moment I don't know which 'public' NTPs are searched for by the Meross devices but that could be easily spotted by sniffing your LAN. Here a better explanation of the scenario

0.north-america.pool.ntp.org is the one called by MSS315 devices (assuming it only uses DNS and doesn't have hardcoded IP addresses)