dingo35 / SmartEVSE-3.5

Smart Electric Vehicle Charging Station (EVSE)
MIT License
43 stars 20 forks source link

MQTT /Set/Mainsmeter not updating mains currents #103

Closed jongdesteven closed 1 month ago

jongdesteven commented 1 month ago

Describe the bug When updating mainsmeter data from mqtt, this is not updated in smartevse

Upload your config {"version":"11:18:12 @Jul 16 2024","serialnr":7311,"mode":"SOLAR","mode_id":2,"car_connected":false,"wifi":{"status":"WL_CONNECTED","ssid":"Starlink IOT","rssi":-72,"bssid":"B0:4E:26:AB:A2:5C"},"evse":{"temp":27,"temp_max":65,"connected":false,"access":true,"mode":2,"loadbl":0,"pwm":1024,"solar_stop_timer":0,"state":"Ready to Charge","state_id":0,"error":"Communication Error","error_id":2,"rfid":"Not Installed"},"settings":{"charge_current":0,"override_current":0,"current_min":6,"current_max":16,"current_main":25,"current_max_circuit":16,"current_max_sum_mains":600,"max_sum_mains_time":0,"solar_max_import":0,"solar_start_current":8,"solar_stop_time":10,"enable_C2":"Not present","mains_meter":"API","starttime":0,"stoptime":0,"repeat":0},"mqtt":{"host":"tinysrv.local","port":1883,"topic_prefix":"SmartEVSE-7311","username":"mqtt","password_set":true,"status":"Connected"},"home_battery":{"current":0,"last_update":0},"ev_meter":{"description":"Eastron3P","address":12,"import_active_power":0,"total_kwh":32.90000153,"charged_kwh":0,"currents":{"TOTAL":0,"L1":0,"L2":0,"L3":0},"import_active_energy":32.90000153,"export_active_energy":0},"mains_meter":{"import_active_energy":0,"export_active_energy":0},"phase_currents":{"TOTAL":0,"L1":0,"L2":0,"L3":0,"last_data_update":0,"original_data":{"TOTAL":0,"L1":0,"L2":0,"L3":0}},"backlight":{"timer":120,"status":"ON"}}

Upload a debug log (I) (printStatus)(C0) L1: 0.0 A L2: 0.0 A L3: 0.0 A Isum: 0.0 A (V) (fn_mqtt)(C1) 3 RECEIVED -8:-6:-4 <- SmartEVSE-7311/Set/Mainsmeter (V) (fn_mqtt)(C1) 3 RECEIVED -8:-6:-4 <- SmartEVSE-7311/Set/Mainsmeter (D) (Timer100ms)(C0) ModbusRequest 4: Request Energy Node 0 (V) (ModbusSend8)(C0) Sent packet address: 0x0c, function: 0x04, reg: 0x0048, token:0x0c040048, data: 0x0002. (V) (ModbusDecode)(C1) Received packet (7 bytes) 0c 04 04 42 03 85 1f (V) (ModbusDecode)(C1) valid Modbus packet: Address 0x0c Function 0x04 Register 0x0048 Response (V) (ModbusSend8)(C0) Sent packet address: 0x0c, function: 0x04, reg: 0x0034, token:0x0c040034, data: 0x0002. (V) (ModbusDecode)(C1) Received packet (7 bytes) 0c 04 04 00 00 00 00 (V) (ModbusDecode)(C1) valid Modbus packet: Address 0x0c Function 0x04 Register 0x0034 Response (D) (Timer100ms)(C0) ModbusRequest 20: Request EVMeter Current Measurement Node 0 (V) (ModbusSend8)(C0) Sent packet address: 0x0c, function: 0x04, reg: 0x0006, token:0x0c040006, data: 0x000c. (V) (ModbusDecode)(C1) Received packet (27 bytes) 0c 04 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [0;32m(V) (ModbusSend8)(C0) Sent packet address: 0x0c, function: 0x04, reg: 0x0006, token:0x0c040006, data: 0x000c. (V) (ModbusDecode)(C1) Received packet (27 bytes) 0c 04 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (V) (CalcBalancedCurrent)(C0) Checkpoint 1 Isetbalanced=0.0 A Imeasured=0.0 A MaxCircuit=16 Imeasured_EV=0.0 A, Battery Current = 0.0 A, mode=2. (V) (CalcBalancedCurrent)(C0) Checkpoint 2 Isetbalanced=0.0 A, Idifference=16.0, mod=0. (V) (CalcBalancedCurrent)(C0) Checkpoint 3 Isetbalanced=0.0 A, IsumImport=0.0, Isum=0.0, ImportCurrent=0. (V) (CalcBalancedCurrent)(C0) Checkpoint 4 Isetbalanced=0.0 A. (V) (CalcBalancedCurrent)(C0) Checkpoint 5 Isetbalanced=0.0 A. (I) (printStatus)(C0) STATE: A Error: 2 StartCurrent: -8 ChargeDelay: 0 SolarStopTimer: 0 NoCurrent: 0 Imeasured: 0.0 A IsetBalanced: 0.0 A, MainsMeterTimeout=0, EVMeterTimeout=64. (I) (printStatus)(C0) L1: 0.0 A L2: 0.0 A L3: 0.0 A Isum: 0.0 A

To Reproduce Steps to reproduce the behavior: In solar mode, above screenshot is using your nightly with improved wifi reconnect, this was tested also on default 3.6.5-debug version.

Expected behavior I believe it was working via Rest,

jongdesteven commented 1 month ago

Closing issue, typo: Mainsmeter -> MainsMeter