Skip to content

Commit 0d2e4e7

Browse files
committed
v3.21
1 parent 4ba8c63 commit 0d2e4e7

File tree

9 files changed

+7346
-899
lines changed

9 files changed

+7346
-899
lines changed

README.md

Lines changed: 7 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -144,19 +144,19 @@ or to show the help page
144144
If everything works properly, you will see something like this:
145145

146146
```
147-
rscp2mqtt [v3.20]
147+
rscp2mqtt [v3.21]
148148
E3DC system >192.168.178.111:5033< user: >your E3DC user<
149149
MQTT broker >localhost:1883< qos = >0< retain = >false< client id >✗< prefix >e3dc<
150150
Fetching data every second.
151151
Requesting PVI ✓ | PM (0) | DCB ✓ (1 battery string) | Wallbox (0) ✗ | Autorefresh ✓
152152
Log level = 0
153153
Stdout to terminal
154154
155-
[2024-04-20 09:00:00] pid=30200 ppid=1 RscpMqttMain.cpp(2732) Connecting to server 192.168.178.111:5033
156-
[2024-04-20 09:00:00] pid=30200 ppid=1 RscpMqttMain.cpp(2739) Success: E3DC connected.
157-
[2024-04-20 09:00:00] pid=30200 ppid=1 RscpMqttMain.cpp(1723) RSCP authentication level 10
158-
[2024-04-20 09:00:00] pid=30200 ppid=1 RscpMqttMain.cpp(2257) Connecting to broker localhost:1883
159-
[2024-04-20 09:00:00] pid=30200 ppid=1 RscpMqttMain.cpp(2269) Success: MQTT broker connected.
155+
[2024-04-28 09:00:00] pid=30210 ppid=1 RscpMqttMain.cpp(2805) Connecting to server 192.168.178.111:5033
156+
[2024-04-28 09:00:00] pid=30210 ppid=1 RscpMqttMain.cpp(2812) Success: E3DC connected.
157+
[2024-04-28 09:00:00] pid=30210 ppid=1 RscpMqttMain.cpp(1791) RSCP authentication level 10
158+
[2024-04-28 09:00:00] pid=30210 ppid=1 RscpMqttMain.cpp(2325) Connecting to broker localhost:1883
159+
[2024-04-28 09:00:00] pid=30210 ppid=1 RscpMqttMain.cpp(2337) Success: MQTT broker connected.
160160
```
161161

162162
Check the configuration if the connections are not established.
@@ -348,48 +348,7 @@ AUTO_REFRESH=true
348348

349349
## Wallbox Control
350350

351-
Select the wallbox (0..7) to be used
352-
```
353-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/index" -m "0"
354-
```
355-
356-
The following calls will use the set wallbox.
357-
358-
Set solar or mix mode with the current in [A] (6..32 Ampere)
359-
```
360-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "solar:16"
361-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "mix:8"
362-
```
363-
364-
Stop charging
365-
```
366-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "stop"
367-
```
368-
369-
Set discharge battery to car mode (true/1/false/0)
370-
```
371-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/discharge_battery_to_car" -m true
372-
```
373-
374-
Set charge battery before car mode (true/1/false/0)
375-
```
376-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/charge_battery_before_car" -m true
377-
```
378-
379-
Set discharge battery until [%]
380-
```
381-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/discharge_battery_until" -m 80
382-
```
383-
384-
Set disable charging battery at mix mode (true/1/false/0)
385-
```
386-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/disable_battery_at_mix_mode" -m true
387-
```
388-
389-
Set number of phases (1/3)
390-
```
391-
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/number_phases" -m 1
392-
```
351+
The commands for controlling an E3/DC wallbox can be found [here](WALLBOX.md).
393352

394353
## Historical daily data
395354

RELEASE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## Release Notes
22

3+
### Release v3.21 (28.04.2024)
4+
5+
Features:
6+
- Issue #62: Daily wallbox energy values
7+
- Issue #63: New wallbox control commands for charging, sun/mix mode and max_current
8+
- Updated RscpTags.h
9+
- Logging with tag names instead of hex numbers
10+
311
### Release v3.20 (20.04.2024)
412

513
Bug fixes:

RscpMqttConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef struct _config_t {
4040
bool verbose;
4141
int interval;
4242
int log_level;
43+
bool save_memory;
4344
int battery_strings;
4445
bool pvi_requests;
4546
int pvi_tracker;

RscpMqttMain.cpp

Lines changed: 113 additions & 39 deletions
Large diffs are not rendered by default.

RscpMqttMapping.h

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@
5757
#define IDX_GRID_IN_DURATION 14
5858
#define IDX_SUN_DURATION 15
5959
#define IDX_WALLBOX_INDEX 16
60-
#define IDX_WALLBOX_LAST_ENERGY_ALL 17
61-
#define IDX_WALLBOX_LAST_ENERGY_SOLAR 18
60+
#define IDX_WALLBOX_DAY_ENERGY_ALL 17
61+
#define IDX_WALLBOX_DAY_ENERGY_SOLAR 18
62+
#define IDX_WALLBOX_ENERGY_ALL_START 19
63+
#define IDX_WALLBOX_ENERGY_SOLAR_START 20
64+
#define IDX_WALLBOX_LAST_ENERGY_ALL 21
65+
#define IDX_WALLBOX_LAST_ENERGY_SOLAR 22
6266
#define IDX_PM_POWER 100
6367
#define IDX_PM_ENERGY 200
6468
#define IDX_PVI_ENERGY 300
@@ -155,13 +159,15 @@ cache_t cache[] = {
155159
{ 0, 0, IDX_GRID_IN_DURATION, "grid_in_limit_duration", "", F_AUTO, UNIT_MIN, 1, 0, false, false, false },
156160
{ 0, 0, IDX_SUN_DURATION, "sunshine_duration", "", F_AUTO, UNIT_MIN, 1, 0, false, false, false },
157161
{ 0, 0, IDX_WALLBOX_INDEX, "wallbox/index", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
162+
{ 0, 0, IDX_WALLBOX_DAY_ENERGY_ALL, "wallbox/energy/day/total", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
163+
{ 0, 0, IDX_WALLBOX_DAY_ENERGY_SOLAR, "wallbox/energy/day/solar", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
164+
{ 0, 0, IDX_WALLBOX_ENERGY_ALL_START, "wallbox/energy_start/total", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
165+
{ 0, 0, IDX_WALLBOX_ENERGY_SOLAR_START, "wallbox/energy_start/solar", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
158166
{ 0, 0, IDX_WALLBOX_LAST_ENERGY_ALL, "wallbox/energy/last_charging/total", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
159167
{ 0, 0, IDX_WALLBOX_LAST_ENERGY_SOLAR, "wallbox/energy/last_charging/solar", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
160168
{ 0, TAG_INFO_SW_RELEASE, 0, "system/software", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
161169
{ 0, TAG_INFO_PRODUCTION_DATE, 0, "system/production_date", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
162170
{ 0, TAG_INFO_SERIAL_NUMBER, 0, "system/serial_number", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
163-
{ 0, TAG_INFO_TIME, 0, "time/local", "", F_AUTO, UNIT_SEC, 1, 0, false, false, false },
164-
{ 0, TAG_INFO_UTC_TIME, 0, "time/utc", "", F_AUTO, UNIT_SEC, 1, 0, false, false, false },
165171
{ 0, TAG_INFO_TIME_ZONE, 0, "time/zone", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
166172
{ 0, TAG_EMS_POWER_PV, 0, "solar/power", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
167173
{ 0, TAG_EMS_POWER_BAT, 0, "battery/power", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
@@ -207,10 +213,6 @@ cache_t cache[] = {
207213
{ TAG_EMS_GET_POWER_SETTINGS, TAG_EMS_DISCHARGE_START_POWER, 0, "ems/discharge_start/power", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
208214
{ TAG_EMS_GET_POWER_SETTINGS, TAG_EMS_POWERSAVE_ENABLED, 0, "ems/power_save", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
209215
{ TAG_EMS_GET_POWER_SETTINGS, TAG_EMS_WEATHER_REGULATED_CHARGE_ENABLED, 0, "ems/weather_regulation", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
210-
// CONTAINER TAG_EMS_SET_POWER_SETTINGS
211-
{ TAG_EMS_SET_POWER_SETTINGS, TAG_EMS_RES_DISCHARGE_START_POWER, 0, "ems/discharge_start/status", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
212-
{ TAG_EMS_SET_POWER_SETTINGS, TAG_EMS_RES_MAX_CHARGE_POWER, 0, "ems/max_charge/status", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
213-
{ TAG_EMS_SET_POWER_SETTINGS, TAG_EMS_RES_MAX_DISCHARGE_POWER, 0, "ems/max_discharge/status", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
214216
// CONTAINER TAG_PVI_DATA
215217
{ TAG_PVI_AC_POWER, TAG_PVI_VALUE, 0, "pvi/power/L1", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
216218
{ TAG_PVI_AC_POWER, TAG_PVI_VALUE, 1, "pvi/power/L2", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
@@ -440,12 +442,13 @@ cache_t templates[] = {
440442
{ TAG_WB_DATA, TAG_WB_PM_POWER_L1, 0, "wallbox/power/L1", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
441443
{ TAG_WB_DATA, TAG_WB_PM_POWER_L2, 0, "wallbox/power/L2", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
442444
{ TAG_WB_DATA, TAG_WB_PM_POWER_L3, 0, "wallbox/power/L3", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
445+
{ TAG_WB_DATA, TAG_WB_AVAILABLE_SOLAR_POWER, 0, "wallbox/available_solar_power", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
443446
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 3, "wallbox/max_current", "", F_AUTO, UNIT_A, 1, 0, false, false, false },
444447
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/status", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
445448
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/plugged", "", F_AUTO, UNIT_NONE, 1, 8, false, false, false },
446449
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/locked", "", F_AUTO, UNIT_NONE, 1, 16, false, false, false },
447450
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/charging", "", F_AUTO, UNIT_NONE, 1, 32, false, false, false },
448-
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/canceled", "", F_AUTO, UNIT_NONE, 1, 64, false, false, false },
451+
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/suspended", "", F_AUTO, UNIT_NONE, 1, 64, false, false, false },
449452
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/sun_mode", "", F_AUTO, UNIT_NONE, 1, 128, false, false, false }
450453
};
451454

@@ -483,7 +486,11 @@ rec_cache_t rec_cache[] = {
483486
{ 0, TAG_EMS_REQ_SET_BATTERY_BEFORE_CAR_MODE, "set/wallbox/charge_battery_before_car", "^true|on|1$", "1", "^false|off|0$", "0", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true },
484487
{ 0, TAG_EMS_REQ_SET_WB_DISCHARGE_BAT_UNTIL, "set/wallbox/discharge_battery_until", PAYLOAD_REGEX_2_DIGIT, "", "", "", "", UNIT_PERCENT, RSCP::eTypeUChar8, -1, false, true },
485488
{ 0, TAG_EMS_REQ_SET_WALLBOX_ENFORCE_POWER_ASSIGNMENT, "set/wallbox/disable_battery_at_mix_mode", "^true|on|1$", "true", "^false|off|0$", "false", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
486-
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/control", "^solar:[0-9]{1,2}$|^mix:[0-9]{1,2}$|^stop$", "", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
489+
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/control", "^solar:[0-9]{1,2}$|^mix:[0-9]{1,2}$|^stop$", "", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true }, // deprecated
490+
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/sun_mode", "^true|on|1$", "1", "^false|off|0$", "0", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
491+
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/toggle", "^true|on|1$", "1", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
492+
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/charge", "^true|on|1$", "1", "^false|off|0$", "0", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
493+
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/max_current", "^[0-9]{1,2}$", "", "", "", "", UNIT_A, RSCP::eTypeBool, -1, false, true },
487494
{ TAG_WB_REQ_DATA, TAG_WB_REQ_SET_NUMBER_PHASES, "set/wallbox/number_phases", "^1|3$", "", "", "", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true },
488495
{ 0, 0, "set/requests/pm", "^true|on|1$", "true", "^false|off|0$", "false", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
489496
{ 0, 0, "set/requests/pvi", "^true|on|1$", "true", "^false|off|0$", "false", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },

0 commit comments

Comments
 (0)