Skip to content

Commit

Permalink
v3.21
Browse files Browse the repository at this point in the history
  • Loading branch information
pvtom committed Apr 28, 2024
1 parent 4ba8c63 commit 0d2e4e7
Show file tree
Hide file tree
Showing 9 changed files with 7,346 additions and 899 deletions.
55 changes: 7 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,19 @@ or to show the help page
If everything works properly, you will see something like this:

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

Check the configuration if the connections are not established.
Expand Down Expand Up @@ -348,48 +348,7 @@ AUTO_REFRESH=true

## Wallbox Control

Select the wallbox (0..7) to be used
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/index" -m "0"
```

The following calls will use the set wallbox.

Set solar or mix mode with the current in [A] (6..32 Ampere)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "solar:16"
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "mix:8"
```

Stop charging
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "stop"
```

Set discharge battery to car mode (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/discharge_battery_to_car" -m true
```

Set charge battery before car mode (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/charge_battery_before_car" -m true
```

Set discharge battery until [%]
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/discharge_battery_until" -m 80
```

Set disable charging battery at mix mode (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/disable_battery_at_mix_mode" -m true
```

Set number of phases (1/3)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/number_phases" -m 1
```
The commands for controlling an E3/DC wallbox can be found [here](WALLBOX.md).

## Historical daily data

Expand Down
8 changes: 8 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Release Notes

### Release v3.21 (28.04.2024)

Features:
- Issue #62: Daily wallbox energy values
- Issue #63: New wallbox control commands for charging, sun/mix mode and max_current
- Updated RscpTags.h
- Logging with tag names instead of hex numbers

### Release v3.20 (20.04.2024)

Bug fixes:
Expand Down
1 change: 1 addition & 0 deletions RscpMqttConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ typedef struct _config_t {
bool verbose;
int interval;
int log_level;
bool save_memory;
int battery_strings;
bool pvi_requests;
int pvi_tracker;
Expand Down
152 changes: 113 additions & 39 deletions RscpMqttMain.cpp

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions RscpMqttMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@
#define IDX_GRID_IN_DURATION 14
#define IDX_SUN_DURATION 15
#define IDX_WALLBOX_INDEX 16
#define IDX_WALLBOX_LAST_ENERGY_ALL 17
#define IDX_WALLBOX_LAST_ENERGY_SOLAR 18
#define IDX_WALLBOX_DAY_ENERGY_ALL 17
#define IDX_WALLBOX_DAY_ENERGY_SOLAR 18
#define IDX_WALLBOX_ENERGY_ALL_START 19
#define IDX_WALLBOX_ENERGY_SOLAR_START 20
#define IDX_WALLBOX_LAST_ENERGY_ALL 21
#define IDX_WALLBOX_LAST_ENERGY_SOLAR 22
#define IDX_PM_POWER 100
#define IDX_PM_ENERGY 200
#define IDX_PVI_ENERGY 300
Expand Down Expand Up @@ -155,13 +159,15 @@ cache_t cache[] = {
{ 0, 0, IDX_GRID_IN_DURATION, "grid_in_limit_duration", "", F_AUTO, UNIT_MIN, 1, 0, false, false, false },
{ 0, 0, IDX_SUN_DURATION, "sunshine_duration", "", F_AUTO, UNIT_MIN, 1, 0, false, false, false },
{ 0, 0, IDX_WALLBOX_INDEX, "wallbox/index", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ 0, 0, IDX_WALLBOX_DAY_ENERGY_ALL, "wallbox/energy/day/total", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
{ 0, 0, IDX_WALLBOX_DAY_ENERGY_SOLAR, "wallbox/energy/day/solar", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
{ 0, 0, IDX_WALLBOX_ENERGY_ALL_START, "wallbox/energy_start/total", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
{ 0, 0, IDX_WALLBOX_ENERGY_SOLAR_START, "wallbox/energy_start/solar", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
{ 0, 0, IDX_WALLBOX_LAST_ENERGY_ALL, "wallbox/energy/last_charging/total", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
{ 0, 0, IDX_WALLBOX_LAST_ENERGY_SOLAR, "wallbox/energy/last_charging/solar", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
{ 0, TAG_INFO_SW_RELEASE, 0, "system/software", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ 0, TAG_INFO_PRODUCTION_DATE, 0, "system/production_date", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ 0, TAG_INFO_SERIAL_NUMBER, 0, "system/serial_number", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ 0, TAG_INFO_TIME, 0, "time/local", "", F_AUTO, UNIT_SEC, 1, 0, false, false, false },
{ 0, TAG_INFO_UTC_TIME, 0, "time/utc", "", F_AUTO, UNIT_SEC, 1, 0, false, false, false },
{ 0, TAG_INFO_TIME_ZONE, 0, "time/zone", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ 0, TAG_EMS_POWER_PV, 0, "solar/power", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
{ 0, TAG_EMS_POWER_BAT, 0, "battery/power", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
Expand Down Expand Up @@ -207,10 +213,6 @@ cache_t cache[] = {
{ TAG_EMS_GET_POWER_SETTINGS, TAG_EMS_DISCHARGE_START_POWER, 0, "ems/discharge_start/power", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
{ TAG_EMS_GET_POWER_SETTINGS, TAG_EMS_POWERSAVE_ENABLED, 0, "ems/power_save", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ TAG_EMS_GET_POWER_SETTINGS, TAG_EMS_WEATHER_REGULATED_CHARGE_ENABLED, 0, "ems/weather_regulation", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
// CONTAINER TAG_EMS_SET_POWER_SETTINGS
{ 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 },
{ 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 },
{ 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 },
// CONTAINER TAG_PVI_DATA
{ TAG_PVI_AC_POWER, TAG_PVI_VALUE, 0, "pvi/power/L1", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
{ TAG_PVI_AC_POWER, TAG_PVI_VALUE, 1, "pvi/power/L2", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
Expand Down Expand Up @@ -440,12 +442,13 @@ cache_t templates[] = {
{ TAG_WB_DATA, TAG_WB_PM_POWER_L1, 0, "wallbox/power/L1", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_POWER_L2, 0, "wallbox/power/L2", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_POWER_L3, 0, "wallbox/power/L3", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_AVAILABLE_SOLAR_POWER, 0, "wallbox/available_solar_power", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 3, "wallbox/max_current", "", F_AUTO, UNIT_A, 1, 0, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/status", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/plugged", "", F_AUTO, UNIT_NONE, 1, 8, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/locked", "", F_AUTO, UNIT_NONE, 1, 16, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/charging", "", F_AUTO, UNIT_NONE, 1, 32, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/canceled", "", F_AUTO, UNIT_NONE, 1, 64, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/suspended", "", F_AUTO, UNIT_NONE, 1, 64, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2, "wallbox/sun_mode", "", F_AUTO, UNIT_NONE, 1, 128, false, false, false }
};

Expand Down Expand Up @@ -483,7 +486,11 @@ rec_cache_t rec_cache[] = {
{ 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 },
{ 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 },
{ 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 },
{ 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 },
{ 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
{ 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 },
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/toggle", "^true|on|1$", "1", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
{ 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 },
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "set/wallbox/max_current", "^[0-9]{1,2}$", "", "", "", "", UNIT_A, RSCP::eTypeBool, -1, false, true },
{ TAG_WB_REQ_DATA, TAG_WB_REQ_SET_NUMBER_PHASES, "set/wallbox/number_phases", "^1|3$", "", "", "", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true },
{ 0, 0, "set/requests/pm", "^true|on|1$", "true", "^false|off|0$", "false", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
{ 0, 0, "set/requests/pvi", "^true|on|1$", "true", "^false|off|0$", "false", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
Expand Down
Loading

0 comments on commit 0d2e4e7

Please sign in to comment.