dingo35 / ha-SmartEVSEv3

Integrate SmartEVSEv3 with HomeAssistant through custom component
13 stars 8 forks source link

total kWh sometimes does not get updated. resulting in large increase when it is updated #21

Closed djoenez closed 7 months ago

djoenez commented 8 months ago

Hello,

I sometimes have that for a couple of days the new kWh is not being pushed for some reason. resulting in very large increases in 5 minutes: image

Is there something i could do?

dingo35 commented 8 months ago

Homeassistant is supposed to update this (off the top of my head) every 5 minutes...

Stuff you might try: -update to newest HA version -use an MQTT server between HA and SmartEVSE; MQTT is very light and can update every 10 seconds

dingo35 commented 8 months ago

How do you feed this info to SmartEVSE? Modbus or API?

djoenez commented 8 months ago

Hello Dingo35,

Thanks for your quick reply. HA is updated, and i'm now purging all MQTT in favor of the rest HACS API (no double logging), would you say that MQTT is the better option here? The info is fed in by modbus from the kWh meter.

dingo35 commented 8 months ago

MQTT is supposed to be lighter than the REST API , both on SmartEVSE cpu as on the wifi channel.

If I remember correctly you have MasterSlave config right?

If you are not using Modbus TCP bridge I can provide you with a more stable test version than current Serkri. Can you compile yourself?

djoenez commented 8 months ago

Hello Dingo,

Thanks. I'll move to MQTT then, just in time, i was starting to change the automations now :) (I now have my own yaml sensors for evse, the HACS plugin and the MQTT. want to remove 2 and keep only one).

Will the MQTT part be updated the same as the REST part?

I have a masterslaveconfig yes, i'm not using a modbus TCP bridge, i just have a local modbus "network" of 2 evses and a SDM630 and SDM230. Unfortunately i cannot compile myself.

djoenez commented 8 months ago

Also, offtopic question (since i'm potentially moving to MQTT), can i also write my L1,L2,L3 currents to the EVSE with MQTT? do you have an example of how to implement this in HA?

dingo35 commented 8 months ago

master3.5-4ea839f1b2.zip

This is a version that has unstable stuff from Serkri removed, targeted at Master/Slave configurations. The topic to feed your currents is "/Set/MainsMeter", you should send L1:L2:L3 in deciAmpères.

Dus: Topic = SmartEVSE-XXXX/Set/MainsMeter Payload = X:X:X

XXXX is serienr. X:X:X is L1-L3 waarders in deci-A (bv 100:20:20)

djoenez commented 8 months ago

Updated both EVSEs with your 3.5 version, slave EVSE had issues with wifi after update (did not want to connect). But a walk to the shed and doing the wifi setup did the trick.

Thanks for your mqtt help. Let's see if i can get it to work :)

dingo35 commented 8 months ago

No the gui only updates every 4-6s.

djoenez @.***> schreef op 4 januari 2024 09:40:52 CET:

I got it too work. I'm triggering the MQTT publish every second with QOS 0 (since i don't care if a package got lost, the data is already outdated at that time?).

But i see in the GUI that the L1:L2:L3 data is only getting updated every 4-6 seconds. while looking at the MQTT explorer it does get updated every second.

-- Reply to this email directly or view it on GitHub: https://github.com/dingo35/ha-SmartEVSEv3/issues/21#issuecomment-1876710466 You are receiving this because you commented.

Message ID: @.***>

djoenez commented 8 months ago

Sorry about that, i realised this after typing my message, so i deleted my post. Other question on the new version, i see that on my slave the mode is not being exposed to MQTT. is that a feature? Because i would like to know in what mode my slave is in (to check if it is in sync with my master, and to have my slave on when my master has already charged enough).

djoenez commented 8 months ago

First error with the new version: On my slave i get the error: Test IO, needed to reboot to get it to charge again.

dingo35 commented 8 months ago

Are you sure your LAN and your Wifi are stable? All your problems seem to point to connection problems...

dingo35 commented 8 months ago

I can still see the mode of my slave published to MQTT server.

In this version, when the master or the slaves switch mode, the others switch along. Especially Solar vs Smart. Switching from/to Normal is kind of unusual in normal operation environment.

djoenez @.***> schreef op 4 januari 2024 10:26:09 CET:

Sorry about that, i realised this after typing my message, so i deleted my post. Other question on the new version, i see that on my slave the mode is not being exposed to MQTT. is that a feature? Because i would like to know in what mode my slave is in (to check if it is in sync with my master, and to have my slave on when my master has already charged enough).

-- Reply to this email directly or view it on GitHub: https://github.com/dingo35/ha-SmartEVSEv3/issues/21#issuecomment-1876769635 You are receiving this because you commented.

Message ID: @.***>

djoenez commented 7 months ago

On lan/wifi, you were right. It seems that the Evse chose the mesh AP in my living room instead of the one in the shed (which is a meter away). Manually forced it to the shed and more stable lately.

I do still see once a day a 0 at my total increasing (this messes up my daily use report in HA) and alot more often 2000+ W on ev current power (while no car is attached).

For the first one, is it possible to set the QOS in the evses to 2? This to make sure it's not lost from EVSE to HA

dingo35 commented 7 months ago

Im sorry but QOS 2 gives a lot more overhead, so if you want that implemented you'll have to compile your own version.

Better improve your network connections, than fighting the symptoms

djoenez commented 7 months ago

I understand your point, it is just that with the REST / HA implementation i did not see any of these errors, and since I pushed the EVSES to my wired AP in the shed manually i did a ping trace for 48 hours which is very stable.

The QOS2 idea was just to make sure nothing goes wrong in the MQTT protocol. I understand that this is not something you want in the general version of the software, it was just an idea to rule-out possible issues.

Thanks for your help, your compiled version is working stabily here since i updated it. I very much appreciate your effort/work.

Just for reference, this is what i see, for now i think i'll simply fix it with a filter. image