Skip to content

Commit

Permalink
v3.17 (Wallbox topics renamed)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvtom committed Mar 16, 2024
1 parent 22c5128 commit bbaf05e
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 55 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ or in verbose mode
If everything works properly, you will see something like this:

```
rscp2mqtt [v3.16]
rscp2mqtt [v3.17]
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-03-01 17:00:00] pid=30160 ppid=1 RscpMqttMain.cpp(2517) Connecting to server 192.168.178.111:5033
[2024-03-01 17:00:00] pid=30160 ppid=1 RscpMqttMain.cpp(2524) Success: E3DC connected.
[2024-03-01 17:00:00] pid=30160 ppid=1 RscpMqttMain.cpp(1533) RSCP authentication level 10
[2024-03-01 17:00:00] pid=30160 ppid=1 RscpMqttMain.cpp(2064) Connecting to broker localhost:1883
[2024-03-01 17:00:00] pid=30160 ppid=1 RscpMqttMain.cpp(2076) Success: MQTT broker connected.
[2024-03-15 17:00:00] pid=30170 ppid=1 RscpMqttMain.cpp(2515) Connecting to server 192.168.178.111:5033
[2024-03-15 17:00:00] pid=30170 ppid=1 RscpMqttMain.cpp(2522) Success: E3DC connected.
[2024-03-15 17:00:00] pid=30170 ppid=1 RscpMqttMain.cpp(1533) RSCP authentication level 10
[2024-03-15 17:00:00] pid=30170 ppid=1 RscpMqttMain.cpp(2063) Connecting to broker localhost:1883
[2024-03-15 17:00:00] pid=30170 ppid=1 RscpMqttMain.cpp(2075) Success: MQTT broker connected.
```

Check the configuration if the connections are not established.
Expand Down Expand Up @@ -362,19 +362,19 @@ Stop charging
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "stop"
```

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

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

Set battery discharge until [%]
Set discharge battery until [%]
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/battery_discharge_until" -m 80
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)
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Release Notes

### Release v3.17 (16.03.2024)

- Issue #51: Some wallbox topics have been renamed!
Renamed to: discharge_battery_to_car, charge_battery_before_car, discharge_battery_until, disable_battery_at_mix_mode
New: phases/L1, phases/L2, phases/L3 replace active_phases
- Issue #52: "e3dc/set/interval" not considered

### Release v3.16 (01.03.2024)

- Issue #49: Add wallbox data (fixes and add-ons)
Expand Down
10 changes: 4 additions & 6 deletions RscpMqttMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <regex>
#include <mutex>

#define RSCP2MQTT_VERSION "v3.16"
#define RSCP2MQTT_VERSION "v3.17"

#define AES_KEY_SIZE 32
#define AES_BLOCK_SIZE 32
Expand Down Expand Up @@ -2009,7 +2009,6 @@ static void mainLoop(void){
RscpProtocol protocol;
bool bStopExecution = false;
int countdown = 3;
int interval = 1;

while (!bStopExecution) {
//--------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -2109,12 +2108,11 @@ static void mainLoop(void){
countdown--;
if (countdown == 0) {
cleanupCache(RSCP_MQTT::RscpMqttCacheTempl);
interval = cfg.interval;
}
sleep(1);
} else {
wsleep(cfg.interval);
}

// main loop sleep / cycle time before next request
wsleep(interval);
}
}

Expand Down
25 changes: 12 additions & 13 deletions RscpMqttMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,16 @@ cache_t cache[] = {
// WALLBOX
{ 0, TAG_EMS_POWER_WB_ALL, 0, "wallbox/power/total", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
{ 0, TAG_EMS_POWER_WB_SOLAR, 0, "wallbox/power/solar", "", F_AUTO, UNIT_W, 1, 0, false, false, false },
{ 0, TAG_EMS_BATTERY_TO_CAR_MODE, 0, "wallbox/battery_to_car", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ 0, TAG_EMS_BATTERY_BEFORE_CAR_MODE, 0, "wallbox/battery_before_car", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ 0, TAG_EMS_GET_WB_DISCHARGE_BAT_UNTIL, 0, "wallbox/battery_discharge_until", "", F_AUTO, UNIT_PERCENT, 1, 0, false, false, false },
{ 0, TAG_EMS_GET_WALLBOX_ENFORCE_POWER_ASSIGNMENT, 0, "wallbox/disable_battery_at_mix_mode", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_ACTIVE_PHASES, 0, "wallbox/active_phases/L1", "", F_AUTO, UNIT_NONE, 1, 1, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_ACTIVE_PHASES, 0, "wallbox/active_phases/L2", "", F_AUTO, UNIT_NONE, 1, 2, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_ACTIVE_PHASES, 0, "wallbox/active_phases/L3", "", F_AUTO, UNIT_NONE, 1, 4, false, false, false },
{ 0, TAG_EMS_BATTERY_TO_CAR_MODE, 0, "wallbox/discharge_battery_to_car", "", F_AUTO, UNIT_NONE, 1, 1, false, false, false },
{ 0, TAG_EMS_BATTERY_BEFORE_CAR_MODE, 0, "wallbox/charge_battery_before_car", "", F_AUTO, UNIT_NONE, 1, 1, false, false, false },
{ 0, TAG_EMS_GET_WB_DISCHARGE_BAT_UNTIL, 0, "wallbox/discharge_battery_until", "", F_AUTO, UNIT_PERCENT, 1, 0, false, false, false },
{ 0, TAG_EMS_GET_WALLBOX_ENFORCE_POWER_ASSIGNMENT, 0, "wallbox/disable_battery_at_mix_mode", "", F_AUTO, UNIT_NONE, 1, 1, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_ACTIVE_PHASES, 0, "wallbox/phases/L1", "", F_AUTO, UNIT_NONE, 1, 1, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_ACTIVE_PHASES, 0, "wallbox/phases/L2", "", F_AUTO, UNIT_NONE, 1, 2, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_ACTIVE_PHASES, 0, "wallbox/phases/L3", "", F_AUTO, UNIT_NONE, 1, 4, false, false, false },
{ TAG_WB_DATA, TAG_WB_NUMBER_PHASES, 0, "wallbox/number_phases", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_SOC, 0, "wallbox/soc", "", F_AUTO, UNIT_PERCENT, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_KEY_STATE, 0, "wallbox/key_state", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_KEY_STATE, 0, "wallbox/key_state", "", F_AUTO, UNIT_NONE, 1, 1, false, false, false },
{ TAG_WB_DATA, TAG_WB_ENERGY_ALL, 0, "wallbox/energy/total", "", F_FLOAT_0, UNIT_WH, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_ENERGY_SOLAR, 0, "wallbox/energy/solar", "", F_FLOAT_0, UNIT_WH, 1, 0, false, false, false },
{ TAG_WB_DATA, TAG_WB_PM_ENERGY_L1, 0, "wallbox/energy/L1", "", F_FLOAT_0, UNIT_WH, 1, 0, false, false, false },
Expand All @@ -328,8 +328,7 @@ cache_t cache[] = {
{ 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_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 1, "wallbox/number_used_phases", "", F_AUTO, UNIT_NONE, 1, 0, false, false, false },
{ TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 3, "wallbox/max_current", "", F_AUTO, UNIT_NONE, 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 },
Expand Down Expand Up @@ -471,9 +470,9 @@ rec_cache_t rec_cache[] = {
{ TAG_SE_REQ_SET_EP_RESERVE, TAG_SE_PARAM_EP_RESERVE_W, "set/reserve/energy", PAYLOAD_REGEX_5_DIGIT, "", "", "", "", UNIT_WH, RSCP::eTypeFloat32, -1, false, true },
{ 0, 0, "set/power_mode", "^auto$|^idle:[0-9]{1,4}$|^charge:[0-9]{1,5}:[0-9]{1,4}$|^discharge:[0-9]{1,5}:[0-9]{1,4}$|^grid_charge:[0-9]{1,5}:[0-9]{1,4}$", "", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
{ 0, 0, "set/idle_period", SET_IDLE_PERIOD_REGEX, "", "", "", "", UNIT_NONE, RSCP::eTypeBool, -1, false, true },
{ 0, TAG_EMS_REQ_SET_BATTERY_TO_CAR_MODE, "set/wallbox/battery_to_car", "^true|on|1$", "1", "^false|off|0$", "0", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true },
{ 0, TAG_EMS_REQ_SET_BATTERY_BEFORE_CAR_MODE, "set/wallbox/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/battery_discharge_until", PAYLOAD_REGEX_2_DIGIT, "", "", "", "", UNIT_PERCENT, RSCP::eTypeUChar8, -1, false, true },
{ 0, TAG_EMS_REQ_SET_BATTERY_TO_CAR_MODE, "set/wallbox/discharge_battery_to_car", "^true|on|1$", "1", "^false|off|0$", "0", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true },
{ 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_REQ_SET_NUMBER_PHASES, "set/wallbox/number_phases", "^1|3$", "", "", "", "", UNIT_NONE, RSCP::eTypeUChar8, -1, false, true },
Expand Down
22 changes: 11 additions & 11 deletions TOPICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ All topics are listed with the default prefix "e3dc".
| Software Release | e3dc/system/software | "S10_XXXX_XXX" |
| Solar Energy | e3dc/solar/energy | [kWh] |
| Time Zone | e3dc/time/zone | "Europe/City" |
| Wallbox Battery | e3dc/wallbox/battery_before_car | (0,1) |
| Wallbox Battery | e3dc/wallbox/battery_discharge_until | [%] |
| Wallbox Battery | e3dc/wallbox/battery_to_car | (0,1) |
| Wallbox Battery | e3dc/wallbox/charge_battery_before_car | (true/false) |
| Wallbox Battery | e3dc/wallbox/discharge_battery_to_car | (true/false) |
| Wallbox Battery | e3dc/wallbox/discharge_battery_until | [%] |
| Wallbox Battery | e3dc/wallbox/disable_battery_at_mix_mode | (true/false) |
| Wallbox Canceled | e3dc/wallbox/canceled | (true/false) |
| Wallbox Charging | e3dc/wallbox/charging | (true/false) |
| Wallbox Current | e3dc/wallbox/max_current | (true/false) |
| Wallbox Current | e3dc/wallbox/max_current | [A] |
| Wallbox Energy Total | e3dc/wallbox/energy/total | [Wh] |
| Wallbox Energy Total Last Charging | e3dc/wallbox/energy/last_charging/total | [Wh] |
| Wallbox Energy Solar | e3dc/wallbox/energy/solar | [Wh] |
Expand All @@ -231,13 +231,13 @@ All topics are listed with the default prefix "e3dc".
| Wallbox Energy L2 | e3dc/wallbox/energy/L2 | [Wh] |
| Wallbox Energy L3 | e3dc/wallbox/energy/L3 | [Wh] |
| Wallbox Index | e3dc/wallbox/index | (0..7) |
| Wallbox Key State | e3dc/wallbox/key_state | (true/false) |
| Wallbox Locked | e3dc/wallbox/locked | (true/false) |
| Wallbox Mode | e3dc/wallbox/sun_mode | (true/false) |
| Wallbox Phases | e3dc/wallbox/active_phases/L1 | (true/false) |
| Wallbox Phases | e3dc/wallbox/active_phases/L2 | (true/false) |
| Wallbox Phases | e3dc/wallbox/active_phases/L3 | (true/false) |
| Wallbox Phases | e3dc/wallbox/phases/L1 | (true/false) |
| Wallbox Phases | e3dc/wallbox/phases/L2 | (true/false) |
| Wallbox Phases | e3dc/wallbox/phases/L3 | (true/false) |
| Wallbox Phases | e3dc/wallbox/number_phases | |
| Wallbox Phases | e3dc/wallbox/number_used_phases | |
| Wallbox Plugged | e3dc/wallbox/plugged | (true/false) |
| Wallbox Power All | e3dc/wallbox/solar/power | [W] |
| Wallbox Power Solar | e3dc/wallbox/total/power | [W] |
Expand Down Expand Up @@ -318,9 +318,9 @@ Please find detailled information and examples in the [README](README.md).
| Set solar mode with the current in [A] | e3dc/set/wallbox/control | "solar:16" |
| Set mix mode with the current in [A] | e3dc/set/wallbox/control | "mix:8" |
| Stop charging | e3dc/set/wallbox/control | "stop" |
| Set battery to car mode | e3dc/set/wallbox/battery_to_car | (true/false) |
| Set battery before car mode | e3dc/set/wallbox/battery_before_car | (true/false) |
| Set battery discharge until [%] | e3dc/set/wallbox/battery_discharge_until | [%] |
| Set battery to car mode | e3dc/set/wallbox/discharge_battery_to_car | (true/false) |
| Set battery before car mode | e3dc/set/wallbox/charge_battery_before_car | (true/false) |
| Set battery discharge until [%] | e3dc/set/wallbox/discharge_battery_until | [%] |
| Set disable charging battery at mix mode | e3dc/set/wallbox/disable_battery_at_mix_mode | (true/false) |
| Set number of phases (1,3) | e3dc/set/wallbox/number_phases | (1,3) |
| Historical daily data | | |
Expand Down
26 changes: 13 additions & 13 deletions WALLBOX.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ The following topics are sent to the MQTT broker:

| Device / Tag | MQTT Topic | Values / [Unit] |
| --- | --- | --- |
| Wallbox Battery | e3dc/wallbox/battery_to_car | (true/false) |
| Wallbox Battery | e3dc/wallbox/battery_before_car | (true/false) |
| Wallbox Battery | e3dc/wallbox/battery_discharge_until | [%] |
| Wallbox Battery | e3dc/wallbox/charge_battery_before_car | (true/false) |
| Wallbox Battery | e3dc/wallbox/discharge_battery_to_car | (true/false) |
| Wallbox Battery | e3dc/wallbox/discharge_battery_until | [%] |
| Wallbox Battery | e3dc/wallbox/disable_battery_at_mix_mode | (true/false) |
| Wallbox Canceled | e3dc/wallbox/canceled | (true/false) |
| Wallbox Charging | e3dc/wallbox/charging | (true/false) |
| Wallbox Current | e3dc/wallbox/max_current | (true/false) |
| Wallbox Current | e3dc/wallbox/max_current | [A] |
| Wallbox Energy Total | e3dc/wallbox/energy/total | [Wh] |
| Wallbox Energy Total Last Charging | e3dc/wallbox/energy/last_charging/total | [Wh] |
| Wallbox Energy Solar | e3dc/wallbox/energy/solar | [Wh] |
Expand All @@ -29,13 +29,13 @@ The following topics are sent to the MQTT broker:
| Wallbox Energy L2 | e3dc/wallbox/energy/L2 | [Wh] |
| Wallbox Energy L3 | e3dc/wallbox/energy/L3 | [Wh] |
| Wallbox Index | e3dc/wallbox/index | (0..7) |
| Wallbox Key State | e3dc/wallbox/key_state | (true/false) |
| Wallbox Locked | e3dc/wallbox/locked | (true/false) |
| Wallbox Mode | e3dc/wallbox/sun_mode | (true/false) |
| Wallbox Phases | e3dc/wallbox/active_phases/L1 | (true/false) |
| Wallbox Phases | e3dc/wallbox/active_phases/L2 | (true/false) |
| Wallbox Phases | e3dc/wallbox/active_phases/L3 | (true/false) |
| Wallbox Phases | e3dc/wallbox/phases/L1 | (true/false) |
| Wallbox Phases | e3dc/wallbox/phases/L2 | (true/false) |
| Wallbox Phases | e3dc/wallbox/phases/L3 | (true/false) |
| Wallbox Phases | e3dc/wallbox/number_phases | |
| Wallbox Phases | e3dc/wallbox/number_used_phases | |
| Wallbox Plugged | e3dc/wallbox/plugged | (true/false) |
| Wallbox Power All | e3dc/wallbox/total/power | [W] |
| Wallbox Power Solar | e3dc/wallbox/solar/power | [W] |
Expand All @@ -44,7 +44,7 @@ The following topics are sent to the MQTT broker:
| Wallbox Power L3 | e3dc/wallbox/power/L3 | [W] |
| Wallbox SOC | e3dc/wallbox/soc | [%] |

There is a dependency of e3dc/wallbox/battery_before_car to e3dc/wallbox/battery_to_car: e3dc/wallbox/battery_before_car can only be set if e3dc/wallbox/battery_to_car is false (issue #21).
There is a dependency of e3dc/wallbox/charge_battery_before_car to e3dc/wallbox/discharge_battery_to_car: e3dc/wallbox/charge_battery_before_car can only be set if e3dc/wallbox/discharge_battery_to_car is false (issue #21).

In addition, these topics can be published to control the wallbox:

Expand All @@ -68,17 +68,17 @@ mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/control" -m "stop"

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

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

Set battery discharge until [%]
Set discharge battery until [%]
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/battery_discharge_until" -m 80
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)
Expand Down

0 comments on commit bbaf05e

Please sign in to comment.