Switching between charging modes using an external RGB button bypasses RFID authentication
Describe the bug
I have got an EV charger with a SmartEVSE. The SmartEVSE is not accessible to users. Users can only push the RGB button to switch between smart and solar mode and authenticate using an RFID card.
The SmartEVSE is in mode "OFF" and displaying "Present RFID card". The button is configured as Sma-Sol B RFID is set to EnableAll.
When the button is clicked, SmartEVSE changes from "Present RFID card" to "Ready" and mode becomes either Solar or Smart. A charge can be started without RFID verification.
Expected behavior Users can use the charger only after presenting an RFID card (which makes it change from "Present RFID card" to "Ready". The RGB button will light up green or yellow depending on the charge mode.
Users can switch between solar or smart by pressing the button only after their RFID tag has been authenticated. SmartEVSE should be unresponsive to button presses when in "Present RFID card" state.
{
"version": "v3.9.2",
"serialnr": 0000,
"mode": "OFF",
"mode_id": 0,
"car_connected": false,
"wifi": {
"status": "WL_CONNECTED",
"ssid": "REDACTED",
"rssi": -79,
"bssid": "REDACTED"
},
"evse": {
"temp": 13,
"temp_max": 65,
"connected": false,
"access": 0,
"mode": 1,
"loadbl": 0,
"pwm": 1024,
"custombutton": false,
"solar_stop_timer": 0,
"state": "Ready to Charge",
"state_id": 0,
"error": "None",
"error_id": 0,
"rfidreader": "EnableAll",
"nrofphases": 3,
"rfid": "Ready to read card",
"rfid_lastread": "00000000000000"
},
"settings": {
"charge_current": 320,
"override_current": 0,
"current_min": 6,
"current_max": 32,
"current_main": 25,
"current_max_circuit": 32,
"current_max_sum_mains": 0,
"max_sum_mains_time": 0,
"solar_max_import": 0,
"solar_start_current": 6,
"solar_stop_time": 10,
"enable_C2": "Auto",
"mains_meter": "API",
"starttime": 0,
"stoptime": 0,
"repeat": 0,
"lcdlock": 0,
"lock": 1,
"cablelock": 0
},
"mqtt": {
"host": "192.168.12.8",
"port": 1883,
"topic_prefix": "SmartEVSE/REDACTED",
"username": "smartevse-REDACTED",
"password_set": true,
"status": "Connected"
},
"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": "WAGO",
"address": 12,
"import_active_power": 0,
"total_kwh": 41795.4,
"charged_kwh": 34.8,
"currents": {
"TOTAL": 0,
"L1": 0,
"L2": 0,
"L3": 0
},
"import_active_energy": 41795.4,
"export_active_energy": 0
},
"mains_meter": {
"import_active_energy": 0,
"export_active_energy": 0
},
"phase_currents": {
"TOTAL": 19,
"L1": 8,
"L2": 4,
"L3": 7,
"last_data_update": 1763924552,
"original_data": {
"TOTAL": 19,
"L1": 8,
"L2": 4,
"L3": 7
}
},
"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
}
}
}
Yes you are right about this. This is something i also noticed. It's on my to-do list.
There are several options on how to handle this. The solution you describe is the easiest. Better would be to allow mode switches but not allow the controller to get out of the OFF state while doing so. There might be other controllers (Nodes) and these other controllers might not have a RFID reader installed.
The attached firmware has the fix. Pressing the button will not switch off the OFF state. The mode will still change from Solar<->Smart, so that any other other controller will switch to this mode.
Please test. (removed firmware.zip)
There was still a bug in it. Now it completely disables the button when it's in OFF state.
Try this firmware instead.
Hi @mstegen and thanks for providing the test binary. I had the opportunity to test it out tonight and it seems to resolve the issue I was encountering! I've tried switching modes both while the state was OFF as well as READY and the button seems to now work as expected. Charging is functioning as normal but the RFID authentication can't be bypassed by pushing the button anymore. Thanks again for taking the time to fix this.
Great! Thanks for the bug report and testing.