krahabb / meross_lan

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

MSS310 HW 6.0.0 and Update 6.3.21 show 0 as Power and Energy readings #367

Closed Write closed 6 months ago

Write commented 8 months ago

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. Screenshot du 2024-01-06 à 20 32 57

I just bought 3 new MSS310 (Hardware 6.0.0) with update 6.3.21 Screenshot du 2024-01-06 à 20 33 17

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

Screenshot du 2024-01-06 à 20 33 26

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

2024/01/06 - 20:46:59   RX      http    GETACK  Appliance.Control.ToggleX       {"channel": -1, "togglex": [{"channel": 0, "onoff": 0, "lmTime": 1704550289}]}
2024/01/06 - 20:47:13           auto    LOG     DEBUG   polling start
2024/01/06 - 20:47:13   TX      http    GET     Appliance.System.Debug  {"debug": {}}
2024/01/06 - 20:47:14   RX      http    GETACK  Appliance.System.Debug  {"debug": {"system": {"version": "6.3.21", "sysUpTime": "219h1m54s", "UTC": 1704570433, "localTimeOffset": 0, "localTime": "Sat Jan  6 19:47:13 2024", "suncalc": "6:2;18:9", "memTotal": 157504, "memFree": 32224, "memMini": 27264}, "network": {"linkStatus": "connected", "signal": 42, "rssi": -73, "ssid": "###########0", "gatewayMac": "################0", "innerIp": "#########0", "wifiDisconnectCount": 0, "wifiDisconnectDetail": {"totalCount": 0, "detials": []}}, "cloud": {"activeServer": "#########0", "mainServer": "#########0", "mainPort": "@0", "secondServer": "#########0", "secondPort": "@0", "userId": "@0", "sysConnectTime": "Mon Jan  1 23:49:36 2024", "sysOnlineTime": "115h57m37s", "sysDisconnectCount": 5, "iotDisconnectDetail": {"totalCount": 5, "detials": [{"sysUptime": 174638, "timestamp": 1703956555}, {"sysUptime": 175049, "timestamp": 1703956966}, {"sysUptime": 175392, "timestamp": 1703957309}, {"sysUptime": 178629, "timestamp": 1703960545}, {"sysUptime": 370241, "timestamp": 1704152158}]}}}}
2024/01/06 - 20:47:14   TX      http    GET     Appliance.System.All    {"all": {}}
2024/01/06 - 20:47:14   RX      http    GETACK  Appliance.System.All    {"all": {"system": {"hardware": {"type": "mss310", "subType": "un", "version": "6.0.0", "chipType": "rtl8710cf", "uuid": "###############################0", "macAddress": "################0"}, "firmware": {"version": "6.3.21", "compileTime": "2022/10/31-16:22:11", "encrypt": 1, "wifiMac": "################0", "innerIp": "#########0", "server": "#########0", "port": "@0", "userId": "@0"}, "time": {"timestamp": 1704570433, "timezone": "", "timeRule": []}, "online": {"status": 1, "bindId": "uXpSzxGFDAr9T8G5", "who": 1}}, "digest": {"togglex": [{"channel": 0, "onoff": 0, "lmTime": 1704550289}]}}}
2024/01/06 - 20:47:14   TX      http    GET     Appliance.System.DNDMode        {"DNDMode": {}}
2024/01/06 - 20:47:14   RX      http    GETACK  Appliance.System.DNDMode        {"DNDMode": {"mode": 1}}
2024/01/06 - 20:47:14   TX      http    GET     Appliance.Control.Electricity   {"electricity": {}}
2024/01/06 - 20:47:14   RX      http    GETACK  Appliance.Control.Electricity   {"electricity": {"channel": 0, "current": 0, "voltage": 0, "power": 0, "config": {"voltageRatio": 188, "electricityRatio": 102, "maxElectricityCurrent": 11000}}}
2024/01/06 - 20:47:14           auto    LOG     DEBUG   polling end
2024/01/06 - 20:47:44           auto    LOG     DEBUG   polling start
2024/01/06 - 20:47:44   TX      http    GET     Appliance.System.Debug  {"debug": {}}
2024/01/06 - 20:47:44   RX      http    GETACK  Appliance.System.Debug  {"debug": {"system": {"version": "6.3.21", "sysUpTime": "219h2m25s", "UTC": 1704570463, "localTimeOffset": 0, "localTime": "Sat Jan  6 19:47:43 2024", "suncalc": "6:2;18:9", "memTotal": 157504, "memFree": 32224, "memMini": 27264}, "network": {"linkStatus": "connected", "signal": 37, "rssi": -75, "ssid": "###########0", "gatewayMac": "################0", "innerIp": "#########0", "wifiDisconnectCount": 0, "wifiDisconnectDetail": {"totalCount": 0, "detials": []}}, "cloud": {"activeServer": "#########0", "mainServer": "#########0", "mainPort": "@0", "secondServer": "#########0", "secondPort": "@0", "userId": "@0", "sysConnectTime": "Mon Jan  1 23:49:36 2024", "sysOnlineTime": "115h58m7s", "sysDisconnectCount": 5, "iotDisconnectDetail": {"totalCount": 5, "detials": [{"sysUptime": 174638, "timestamp": 1703956555}, {"sysUptime": 175049, "timestamp": 1703956966}, {"sysUptime": 175392, "timestamp": 1703957309}, {"sysUptime": 178629, "timestamp": 1703960545}, {"sysUptime": 370241, "timestamp": 1704152158}]}}}}
2024/01/06 - 20:47:44   TX      http    GET     Appliance.System.All    {"all": {}}
2024/01/06 - 20:47:44   RX      http    GETACK  Appliance.System.All    {"all": {"system": {"hardware": {"type": "mss310", "subType": "un", "version": "6.0.0", "chipType": "rtl8710cf", "uuid": "###############################0", "macAddress": "################0"}, "firmware": {"version": "6.3.21", "compileTime": "2022/10/31-16:22:11", "encrypt": 1, "wifiMac": "################0", "innerIp": "#########0", "server": "#########0", "port": "@0", "userId": "@0"}, "time": {"timestamp": 1704570463, "timezone": "", "timeRule": []}, "online": {"status": 1, "bindId": "uXpSzxGFDAr9T8G5", "who": 1}}, "digest": {"togglex": [{"channel": 0, "onoff": 0, "lmTime": 1704550289}]}}}
2024/01/06 - 20:47:44   TX      http    GET     Appliance.System.DNDMode        {"DNDMode": {}}
2024/01/06 - 20:47:44   RX      http    GETACK  Appliance.System.DNDMode        {"DNDMode": {"mode": 1}}
2024/01/06 - 20:47:44   TX      http    GET     Appliance.Control.Electricity   {"electricity": {}}
2024/01/06 - 20:47:44   RX      http    GETACK  Appliance.Control.Electricity   {"electricity": {"channel": 0, "current": 0, "voltage": 0, "power": 0, "config": {"voltageRatio": 188, "electricityRatio": 102, "maxElectricityCurrent": 11000}}}
2024/01/06 - 20:47:44           auto    LOG     DEBUG   polling end
2024/01/06 - 20:48:14           auto    LOG     DEBUG   polling start
2024/01/06 - 20:48:14   TX      http    GET     Appliance.System.Debug  {"debug": {}}
2024/01/06 - 20:48:14   RX      http    GETACK  Appliance.System.Debug  {"debug": {"system": {"version": "6.3.21", "sysUpTime": "219h2m55s", "UTC": 1704570493, "localTimeOffset": 0, "localTime": "Sat Jan  6 19:48:13 2024", "suncalc": "6:2;18:9", "memTotal": 157504, "memFree": 32224, "memMini": 27264}, "network": {"linkStatus": "connected", "signal": 39, "rssi": -74, "ssid": "###########0", "gatewayMac": "################0", "innerIp": "#########0", "wifiDisconnectCount": 0, "wifiDisconnectDetail": {"totalCount": 0, "detials": []}}, "cloud": {"activeServer": "#########0", "mainServer": "#########0", "mainPort": "@0", "secondServer": "#########0", "secondPort": "@0", "userId": "@0", "sysConnectTime": "Mon Jan  1 23:49:36 2024", "sysOnlineTime": "115h58m37s", "sysDisconnectCount": 5, "iotDisconnectDetail": {"totalCount": 5, "detials": [{"sysUptime": 174638, "timestamp": 1703956555}, {"sysUptime": 175049, "timestamp": 1703956966}, {"sysUptime": 175392, "timestamp": 1703957309}, {"sysUptime": 178629, "timestamp": 1703960545}, {"sysUptime": 370241, "timestamp": 1704152158}]}}}}
2024/01/06 - 20:48:14   TX      http    GET     Appliance.System.All    {"all": {}}
2024/01/06 - 20:48:14   RX      http    GETACK  Appliance.System.All    {"all": {"system": {"hardware": {"type": "mss310", "subType": "un", "version": "6.0.0", "chipType": "rtl8710cf", "uuid": "###############################0", "macAddress": "################0"}, "firmware": {"version": "6.3.21", "compileTime": "2022/10/31-16:22:11", "encrypt": 1, "wifiMac": "################0", "innerIp": "#########0", "server": "#########0", "port": "@0", "userId": "@0"}, "time": {"timestamp": 1704570494, "timezone": "", "timeRule": []}, "online": {"status": 1, "bindId": "uXpSzxGFDAr9T8G5", "who": 1}}, "digest": {"togglex": [{"channel": 0, "onoff": 0, "lmTime": 1704550289}]}}}
2024/01/06 - 20:48:14   TX      http    GET     Appliance.System.DNDMode        {"DNDMode": {}}
2024/01/06 - 20:48:14   RX      http    GETACK  Appliance.System.DNDMode        {"DNDMode": {"mode": 1}}
2024/01/06 - 20:48:14   TX      http    GET     Appliance.Control.ConsumptionX  {"consumptionx": []}
2024/01/06 - 20:48:14   RX      http    GETACK  Appliance.Control.ConsumptionX  {"consumptionx": []}
2024/01/06 - 20:48:14   TX      http    GET     Appliance.Control.Electricity   {"electricity": {}}
2024/01/06 - 20:48:14   RX      http    GETACK  Appliance.Control.Electricity   {"electricity": {"channel": 0, "current": 0, "voltage": 0, "power": 0, "config": {"voltageRatio": 188, "electricityRatio": 102, "maxElectricityCurrent": 11000}}}

Trace logs for an MSS310 w/ Hardware 2.0.0 connected to the same power strip, unused

2024/01/06 - 20:50:55   TX      http    GET     Appliance.System.All    {"all": {}}
2024/01/06 - 20:50:55   RX      http    GETACK  Appliance.System.All    {"all": {"system": {"hardware": {"type": "mss310", "subType": "us", "version": "2.0.0", "chipType": "MT7682", "uuid": "###############################1", "macAddress": "################1"}, "firmware": {"version": "2.1.17", "compileTime": "2022/08/19 10:05:03 GMT +08:00", "wifiMac": "################0", "innerIp": "#########1", "server": "#################1", "port": "@1", "userId": "@1"}, "time": {"timestamp": 1704570655, "timezone": "Europe/Paris", "timeRule": [[1635642000, 3600, 0], [1648342800, 7200, 1], [1667091600, 3600, 0], [1679792400, 7200, 1], [1698541200, 3600, 0], [1711846800, 7200, 1], [1729990800, 3600, 0], [1743296400, 7200, 1], [1761440400, 3600, 0], [1774746000, 7200, 1], [1792890000, 3600, 0], [1806195600, 7200, 1], [1824944400, 3600, 0], [1837645200, 7200, 1], [1856394000, 3600, 0], [1869094800, 7200, 1], [1887843600, 3600, 0], [1901149200, 7200, 1], [1919293200, 3600, 0], [1932598800, 7200, 1]]}, "online": {"status": 0}}, "digest": {"togglex": [{"channel": 0, "onoff": 0, "lmTime": 1704398583}], "triggerx": [], "timerx": []}}}
2024/01/06 - 20:50:55   TX      http    GET     Appliance.System.DNDMode        {"DNDMode": {}}
2024/01/06 - 20:50:55   RX      http    GETACK  Appliance.System.DNDMode        {"DNDMode": {"mode": 1}}
2024/01/06 - 20:50:55   TX      http    GET     Appliance.Control.Electricity   {"electricity": {}}
2024/01/06 - 20:50:55   RX      http    GETACK  Appliance.Control.Electricity   {"electricity": {"channel": 0, "current": 0, "voltage": 2312, "power": 0, "config": {"voltageRatio": 188, "electricityRatio": 100}}}
2024/01/06 - 20:50:55           auto    LOG     DEBUG   polling end
2024/01/06 - 20:50:57   TX      http    GET     Appliance.Control.ConsumptionX  {"consumptionx": []}
2024/01/06 - 20:50:57   RX      http    GETACK  Appliance.Control.ConsumptionX  {"consumptionx": [{"date": "2023-12-31", "time": 1704063482, "value": 0}, {"date": "2024-01-01", "time": 1704149880, "value": 0}, {"date": "2024-01-02", "time": 1704236289, "value": 0}, {"date": "2024-01-03", "time": 1704322688, "value": 0}, {"date": "2024-01-04", "time": 1704409088, "value": 0}, {"date": "2024-01-05", "time": 1704495485, "value": 0}, {"date": "2024-01-06", "time": 1704570652, "value": 0}, {"date": "2023-12-22", "time": 1703285888, "value": 0}, {"date": "2023-12-23", "time": 1703372288, "value": 0}, {"date": "2023-12-24", "time": 1703458688, "value": 156}, {"date": "2023-12-25", "time": 1703545086, "value": 0}, {"date": "2023-12-26", "time": 1703631485, "value": 0}, {"date": "2023-12-27", "time": 1703717880, "value": 0}, {"date": "2023-12-28", "time": 1703804286, "value": 0}, {"date": "2023-12-29", "time": 1703890683, "value": 0}, {"date": "2023-12-30", "time": 1703977083, "value": 8}]}
2024/01/06 - 20:50:59   TX      http    GET     Appliance.Control.Electricity   {"electricity": {}}
2024/01/06 - 20:50:59   RX      http    GETACK  Appliance.Control.Electricity   {"electricity": {"channel": 0, "current": 0, "voltage": 2312, "power": 0, "config": {"voltageRatio": 188, "electricityRatio": 100}}}
2024/01/06 - 20:51:00           auto    LOG     DEBUG   polling start
2024/01/06 - 20:51:00   TX      http    GET     Appliance.System.Debug  {"debug": {}}
2024/01/06 - 20:51:01   RX      http    GETACK  Appliance.System.Debug  {"debug": {"system": {"version": "2.1.17", "sysUpTime": "216h30m54s", "localTimeOffset": 3600, "localTime": "Sat Jan  6 20:51:00 2024", "suncalc": "8:20;16:49"}, "network": {"linkStatus": "connected", "signal": 57, "ssid": "###########0", "gatewayMac": "################0", "innerIp": "#########1", "wifiDisconnectCount": 57}, "cloud": {"activeServer": "#################1", "mainServer": "#################1", "mainPort": "@1", "secondServer": "#################1", "secondPort": "@1", "userId": "@1", "sysConnectTime": "Mon Jan  1 12:49:56 2024", "sysOnlineTime": "127h1m4s", "sysDisconnectCount": 4}}}
2024/01/06 - 20:51:01   TX      http    GET     Appliance.System.All    {"all": {}}
2024/01/06 - 20:51:01   RX      http    GETACK  Appliance.System.All    {"all": {"system": {"hardware": {"type": "mss310", "subType": "us", "version": "2.0.0", "chipType": "MT7682", "uuid": "###############################1", "macAddress": "################1"}, "firmware": {"version": "2.1.17", "compileTime": "2022/08/19 10:05:03 GMT +08:00", "wifiMac": "################0", "innerIp": "#########1", "server": "#################1", "port": "@1", "userId": "@1"}, "time": {"timestamp": 1704570660, "timezone": "Europe/Paris", "timeRule": [[1635642000, 3600, 0], [1648342800, 7200, 1], [1667091600, 3600, 0], [1679792400, 7200, 1], [1698541200, 3600, 0], [1711846800, 7200, 1], [1729990800, 3600, 0], [1743296400, 7200, 1], [1761440400, 3600, 0], [1774746000, 7200, 1], [1792890000, 3600, 0], [1806195600, 7200, 1], [1824944400, 3600, 0], [1837645200, 7200, 1], [1856394000, 3600, 0], [1869094800, 7200, 1], [1887843600, 3600, 0], [1901149200, 7200, 1], [1919293200, 3600, 0], [1932598800, 7200, 1]]}, "online": {"status": 0}}, "digest": {"togglex": [{"channel": 0, "onoff": 0, "lmTime": 1704398583}], "triggerx": [], "timerx": []}}}
2024/01/06 - 20:51:01   TX      http    GET     Appliance.System.DNDMode        {"DNDMode": {}}
2024/01/06 - 20:51:01   TX      http    GET     Appliance.Control.ConsumptionConfig     {"consumptionConfig": {}}
2024/01/06 - 20:51:01   RX      http    GETACK  Appliance.System.DNDMode        {"DNDMode": {"mode": 1}}
2024/01/06 - 20:51:01   TX      http    GET     Appliance.Control.Electricity   {"electricity": {}}
2024/01/06 - 20:51:01   RX      http    GETACK  Appliance.Control.ConsumptionConfig     {"config": {"voltageRatio": 188, "electricityRatio": 100}}
2024/01/06 - 20:51:01   RX      http    GETACK  Appliance.Control.Electricity   {"electricity": {"channel": 0, "current": 0, "voltage": 2312, "power": 0, "config": {"voltageRatio": 188, "electricityRatio": 100}}}
2024/01/06 - 20:51:01           auto    LOG     DEBUG   polling end
2024/01/06 - 20:51:06           auto    LOG     DEBUG   polling start
2024/01/06 - 20:51:06   TX      http    GET     Appliance.System.Debug  {"debug": {}}
2024/01/06 - 20:51:06   RX      http    GETACK  Appliance.System.Debug  {"debug": {"system": {"version": "2.1.17", "sysUpTime": "216h30m59s", "localTimeOffset": 3600, "localTime": "Sat Jan  6 20:51:05 2024", "suncalc": "8:20;16:49"}, "network": {"linkStatus": "connected", "signal": 57, "ssid": "###########0", "gatewayMac": "################0", "innerIp": "#########1", "wifiDisconnectCount": 57}, "cloud": {"activeServer": "#################1", "mainServer": "#################1", "mainPort": "@1", "secondServer": "#################1", "secondPort": "@1", "userId": "@1", "sysConnectTime": "Mon Jan  1 12:49:56 2024", "sysOnlineTime": "127h1m9s", "sysDisconnectCount": 4}}}
2024/01/06 - 20:51:06   TX      http    GET     Appliance.System.All    {"all": {}}
2024/01/06 - 20:51:06   RX      http    GETACK  Appliance.System.All    {"all": {"system": {"hardware": {"type": "mss310", "subType": "us", "version": "2.0.0", "chipType": "MT7682", "uuid": "###############################1", "macAddress": "################1"}, "firmware": {"version": "2.1.17", "compileTime": "2022/08/19 10:05:03 GMT +08:00", "wifiMac": "################0", "innerIp": "#########1", "server": "#################1", "port": "@1", "userId": "@1"}, "time": {"timestamp": 1704570665, "timezone": "Europe/Paris", "timeRule": [[1635642000, 3600, 0], [1648342800, 7200, 1], [1667091600, 3600, 0], [1679792400, 7200, 1], [1698541200, 3600, 0], [1711846800, 7200, 1], [1729990800, 3600, 0], [1743296400, 7200, 1], [1761440400, 3600, 0], [1774746000, 7200, 1], [1792890000, 3600, 0], [1806195600, 7200, 1], [1824944400, 3600, 0], [1837645200, 7200, 1], [1856394000, 3600, 0], [1869094800, 7200, 1], [1887843600, 3600, 0], [1901149200, 7200, 1], [1919293200, 3600, 0], [1932598800, 7200, 1]]}, "online": {"status": 0}}, "digest": {"togglex": [{"channel": 0, "onoff": 0, "lmTime": 1704398583}], "triggerx": [], "timerx": []}}}
2024/01/06 - 20:51:06   TX      http    GET     Appliance.System.DNDMode        {"DNDMode": {}}
2024/01/06 - 20:51:09   RX      http    GETACK  Appliance.System.DNDMode        {"DNDMode": {"mode": 1}}
2024/01/06 - 20:51:09   TX      http    GET     Appliance.Control.Electricity   {"electricity": {}}
2024/01/06 - 20:51:09   RX      http    GETACK  Appliance.Control.Electricity   {"electricity": {"channel": 0, "current": 0, "voltage": 2312, "power": 0, "config": {"voltageRatio": 188, "electricityRatio": 100}}}
2024/01/06 - 20:51:09           auto    LOG     DEBUG   polling end
krahabb commented 8 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

Write commented 8 months ago

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.

hamid-elaosta commented 8 months ago

On my MS315 I also had zero values for the monitoring until I set the time zone correctly.

krahabb commented 8 months ago

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

Write commented 8 months ago

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.

Screenshot du 2024-01-09 à 22 25 27

I never managed to be able to connect to the MQTT broker trough meross_lan, hence why I'm using just HTTP method

krahabb commented 8 months ago

Yes, it is available only when the devices are 'fully' locally paired

Write commented 8 months ago

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.

krahabb commented 8 months ago

Some years ago when I've integrated my devices I've followed this procedure to bypass the need for authentication

hamid-elaosta commented 8 months ago

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.

Write commented 8 months ago

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.

hamid-elaosta commented 8 months ago

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!

Write commented 8 months ago

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.

hamid-elaosta commented 8 months ago

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.

Write commented 8 months ago

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 ! Screenshot du 2024-01-10 à 15 47 12

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.

krahabb commented 8 months ago

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

krahabb commented 7 months ago

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: