serkri / SmartEVSE-3

Smart Electric Vehicle Charging Station (EVSE)
MIT License
75 stars 26 forks source link

Request info in interface #34

Closed rvdgaag closed 2 years ago

rvdgaag commented 2 years ago

The EVSE is showing the total of the charged kWh's from the EV Eastron modbus unit.

Really would like to have this info displayed in the web interface too.

Thanks for the great work!

koen-serneels commented 2 years ago

@dingo35 can you have a look perhaps to add this?

dingo35 commented 2 years ago

Sure but I'm a bit busy for the next few weeks, do if there is no hurry you can put it on my list.

fluppie commented 2 years ago

I added this a while ago in evse.cpp around line 2969-2970

        doc["ev_meter"]["EVMeter"] = EMConfig[EVMeter].Desc;
        doc["ev_meter"]["EVMeter_addr"] = EVMeterAddress;
        doc["ev_meter"]["EVMeter_total_kWh"] = EnergyEV;
        doc["ev_meter"]["EVMeter_charged_kWh"] = EnergyCharged;
        doc["ev_meter"]["EVMeter_W"] = PowerMeasured;

afbeelding

I also added a 3 phase and 1 phase eastron modbus meter type. Because the registers are not 100% the same in modbus cpp I added a new case around line 527.

        case EM_1PEASTRON:
            // Phase 1-3 current: Register 0x06 - 0x0B (unsigned)
            // Phase 1-3 power:   Register 0x0C - 0x11 (signed)
            ModbusReadInputRequest(Address, 4, 0x06, 12);
            break;
k-janssens commented 2 years ago

I updated the API and index page, it should include now the EV meter data (if enabled). It's in release v1.3.8-serkri-v3

fluppie commented 2 years ago

Real value is 3148,492 kWh, only have the car for 6 months not 500 years :) afbeelding

k-janssens commented 2 years ago

I don't have a kwh meter connected with my evse so I'm not able to test, what should the value be?

rvdgaag commented 2 years ago

Same issue here, also Charged kWh is factor 1000 to high

k-janssens commented 2 years ago

Ah ok, the measurement is in Wh and not kWh

fluppie commented 2 years ago

Same for the Charged kWh :-) But the power reading is broken, because the 1Phase Eastron meters have a different register, 0x0C vs 0x34 on the 3Phase variants. I fixed that in my own version, but I used your binaries now and that's why it's broken now.

afbeelding

{"1PEastron", ENDIANESS_HBF_HWF, 4, MB_DATATYPE_FLOAT32,    0x0, 0,    0x6, 0,   0x0C, 0,  0x156, 0}, // 1P Eastron SDM230 (V / A / W / kWh) max read count 80
{"3PEastron", ENDIANESS_HBF_HWF, 4, MB_DATATYPE_FLOAT32,    0x0, 0,    0x6, 0,   0x34, 0,  0x156, 0}, // 3P Eastron SDM630 (V / A / W / kWh) max read count 80
dingo35 commented 2 years ago

Suggest we report in kWh, with accuracy of 1 decimal, like all the other kWh values, to prevent unnecessary space occupation of long term storage databases, if any are used.

k-janssens commented 2 years ago

I made some time today to finally move myself to the 1.4 release branch. My changes with the kWh calculation will be soon in the 1.4 release once we merge it with the master.

dingo35 commented 2 years ago

Great, welcome to the future :-) !!!