dingo35 / SmartEVSE-3.5

Smart Electric Vehicle Charging Station (EVSE)
MIT License
46 stars 21 forks source link

Actual power reading not rounded to x decimals when using the very large/precise value as reported by an SDM630 #146

Open rjmgmt opened 1 week ago

rjmgmt commented 1 week ago

Describe the bug When using an Eastron SDM630 Modbus V2 as EVMeter (probably the same when you would be using it as a MainsMet), you get a very precize (lots of digits behind the comma) power reading. This appears not to be rounded up to a reasonable amount of digits behind the comma, leading to an unreadable value on the display.

Upload your config {"version":"v3.7.1","serialnr":xxxx,"mode":"SMART","mode_id":3,"car_connected":false,"wifi":{"status":"WL_CONNECTED","ssid":"HKHQ Home","rssi":-35,"bssid":"BA:FB:E4:C1:E4:54"},"evse":{"temp":29,"temp_max":65,"connected":false,"access":true,"mode":1,"loadbl":0,"pwm":1024,"custombutton":false,"solar_stop_timer":0,"state":"Ready to Charge","state_id":0,"error":"None","error_id":0,"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":0,"max_sum_mains_time":0,"solar_max_import":0,"solar_start_current":6,"solar_stop_time":15,"enable_C2":"Auto","mains_meter":"Sensorbox","starttime":0,"stoptime":0,"repeat":0},"mqtt":{"host":"","port":1883,"topic_prefix":"SmartEVSE-7556","username":"","password_set":false,"status":"Disconnected"},"ocpp":{"mode":"Disabled","backend_url":"","cb_id":"","auth_key":"","auto_auth":"Disabled","auto_auth_idtag":"","status":"Disconnected"},"home_battery":{"current":0,"last_update":0},"ev_meter":{"description":"InvEastrn","address":16,"import_active_power":0,"total_kwh":28.79999924,"charged_kwh":0,"currents":{"TOTAL":0,"L1":0,"L2":0,"L3":0},"import_active_energy":28.79999924,"export_active_energy":0},"mains_meter":{"import_active_energy":0,"export_active_energy":0},"phase_currents":{"TOTAL":12,"L1":2,"L2":19,"L3":-9,"last_data_update":1730124410,"original_data":{"TOTAL":12,"L1":2,"L2":19,"L3":-9}},"backlight":{"timer":0,"status":"OFF"},"color":{"off":{"R":0,"G":0,"B":0},"normal":{"R":0,"G":255,"B":0},"smart":{"R":0,"G":255,"B":0},"solar":{"R":255,"G":170,"B":0},"custom":{"R":0,"G":0,"B":255}}}

Upload a debug log D) (Timer100ms)(C0) ModbusRequest 20: Request EVMeter Current Measurement Node 0 (V) (ModbusSend8)(C0) Sent packet address: 0x10, function: 0x04, reg: 0x0006, token:0x10040006, data: 0x000c. (V) (ModbusDecode)(C1) Received packet (27 bytes) 10 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) (ModbusDecode)(C1) valid Modbus packet: Address 0x10 Function 0x04 Register 0x0006 Response (V) (CalcBalancedCurrent)(C0) Checkpoint 1 Isetbalanced=-6.5 A Imeasured=13.2 A MaxCircuit=16 Imeasured_EV=0.0 A, Battery Current = 0.0 A, mode=2. (V) (CalcBalancedCurrent)(C0) phaseLastUpdate=1730102866. (V) (CalcBalancedCurrent)(C0) Checkpoint 2 Isetbalanced=0.0 A, Idifference=11.8, mod=0. (V) (CalcBalancedCurrent)(C0) Checkpoint 3 Isetbalanced=-6.3 A, IsumImport=12.7, Isum=12.7, ImportCurrent=0. (V) (CalcBalancedCurrent)(C0) Checkpoint 4 Isetbalanced=-6.3 A. (D) (CalcBalancedCurrent)(C0) Checkpoint c: Resetting SolarStopTimer, MaxSumMainsTimer, IsetBalanced=-6.3A, saveActiveEVSE=0. (V) (CalcBalancedCurrent)(C0) Checkpoint 5 Isetbalanced=-6.3 A. (I) (printStatus)(C0) STATE: A Error: 0 StartCurrent: -6 ChargeDelay: 0 SolarStopTimer: 0 NoCurrent: 0 Imeasured: 13.2 A IsetBalanced: -6.3 A, MainsMeter.Timeout=11, EVMeter.Timeout=64. (I) (printStatus)(C0) L1: 13.2 A L2: -0.2 A L3: -0.3 A Isum: 12.7 A

To Reproduce Use SDM630 Modbus V2 as EVmeter Look at the display

Expected behavior A readable value is shown

Screenshots

IMG_8302 Medium

dingo35 commented 6 days ago

I am currently in an area without 230V/50Hz, so I cannot test Eastron devices for the next 5 weeks; please be patient.