dingo35 / SmartEVSE-3.5

Smart Electric Vehicle Charging Station (EVSE)
MIT License
38 stars 13 forks source link

Mains values go up while battery discharge #48

Closed RogMoe closed 2 months ago

RogMoe commented 2 months ago

Describe the bug When (dis)charging the battery, ALL mains-amps go up or down at random. But Sessy battery is only (dis)charging on 1 fase (fase3 in my case).

Upload your config {"version":"v3.5.0-RC2","mode":"OFF","mode_id":0,"car_connected":false,"wifi":{"status":"WL_CONNECTED","ssid":"PCP4","rssi":-50,"bssid":"D0:B2:C4:26:C8:6C"},"evse":{"temp":30,"temp_max":65,"connected":false,"access":false,"mode":2,"loadbl":0,"pwm":1024,"solar_stop_timer":0,"state":"Ready to Charge","state_id":0,"error":"None","error_id":0,"rfid":"Ready to read card"},"settings":{"charge_current":0,"override_current":0,"current_min":6,"current_max":32,"current_main":25,"current_max_circuit":16,"current_max_sum_mains":75,"solar_max_import":0,"solar_start_current":0,"solar_stop_time":0,"enable_C2":"Not present","modem":"Not present","mains_meter":"API","starttime":0,"stoptime":0,"repeat":0},"mqtt":{"host":"192.168.1.14","port":1883,"topic_prefix":"SmartEVSE","username":"mqtt","password_set":true,"status":"Connected"},"home_battery":{"current":-71,"last_update":1712754518},"ev_meter":{"description":"API","address":12,"import_active_power":3,"total_kwh":11487.09961,"charged_kwh":0,"currents":{"TOTAL":124,"L1":0,"L2":0,"L3":124},"import_active_energy":0,"export_active_energy":0},"mains_meter":{"import_active_energy":0,"export_active_energy":0},"phase_currents":{"TOTAL":49,"L1":33,"L2":23,"L3":-7,"last_data_update":1712754518,"original_data":{"TOTAL":-20,"L1":10,"L2":0,"L3":-30}},"backlight":{"timer":0,"status":"OFF"}}

Upload a debug log Flash the debug version of the firmware (see https://github.com/dingo35/SmartEVSE-3.5/blob/master/SmartEVSE-3/HowToFlash.txt), telnet to your device, capture the debug log, cut it so that it shows JUST BEFORE and JUST AFTER the problem arises, and upload it here.

To Reproduce Steps to reproduce the behavior:

  1. What Mode are you in? Normal, Smart or Solar? It happens in all modes, but mostly during switching modes AND while working the battery.

  2. What steps do you take so the problem arises? toggle modes, start/stop Sessy.

Expected behavior A clear and concise description of what you expected to happen; expected Charging Current?

Screenshots Only add screenshots if it adds any information, e.g. when you are reporting a problem on the webserver screen.

smartevse_bug3 smartevse_bug2 smartevse_bug1

dingo35 commented 2 months ago

AFAIK all kWh meters out there add their phases to calculate your rate. The idea on homeBatteryCurrent is that you can manipulate your charging strategy so you can charge from/to your battery; so indeed for optics the homeBatteryCurrent is divided over the three phases. But it shouldnt matter, if your battery is delivering on L3 and you are charging on L1 ... it is L1+L2+L3 you are charged for.

RogMoe commented 2 months ago

It's not the rate I'm concerned about. I'd like the numbers to make sense. Now SmartEVSE gives me a negative figure on two fases while it is impossible to export to the grid on those two fases in the first place. That doesn't make sense to me. All datasets go in pairs of three, except HomeBatteryCurrent. Why? Or should I use a helper to multiply the value by three myself before sending it to SmartEVSE?

dingo35 commented 2 months ago

If you want it to make sense, look at the values in the "original" screen... those are the actual values of your MainsMeter.

RogMoe commented 2 months ago

What is the benefit in using HomeBatteryCurrent data in SmartEVSE? Does it get used in the overall calculation or is it just "FYI"?

I charge a homebattery using its NOM setting. How to combine that with SmartEVSE in solarmode if not using HomeAssistant? Charging an EV with batterypower sounds like a bad idea. What are your thoughts on this? Thx

dingo35 commented 2 months ago

grep -i homebatterycurrent src/evse.cpp