Skip to content

Commit

Permalink
v3.22
Browse files Browse the repository at this point in the history
  • Loading branch information
pvtom committed Apr 29, 2024
1 parent 0d2e4e7 commit 5cf3b0b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 26 deletions.
12 changes: 6 additions & 6 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.21]
rscp2mqtt [v3.22]
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-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.
[2024-04-29 19:00:00] pid=30220 ppid=1 RscpMqttMain.cpp(2804) Connecting to server 192.168.178.111:5033
[2024-04-29 19:00:00] pid=30220 ppid=1 RscpMqttMain.cpp(2811) Success: E3DC connected.
[2024-04-29 19:00:00] pid=30220 ppid=1 RscpMqttMain.cpp(1790) RSCP authentication level 10
[2024-04-29 19:00:00] pid=30220 ppid=1 RscpMqttMain.cpp(2324) Connecting to broker localhost:1883
[2024-04-29 19:00:00] pid=30220 ppid=1 RscpMqttMain.cpp(2336) Success: MQTT broker connected.
```

Check the configuration if the connections are not established.
Expand Down
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Release Notes

### Release v3.22 (29.04.2024)

- Issue #63: e3dc/set/wallbox/charge is renamed to e3dc/set/wallbox/suspended

### Release v3.21 (28.04.2024)

Features:
Expand Down
13 changes: 6 additions & 7 deletions RscpMqttMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <regex>
#include <mutex>

#define RSCP2MQTT_VERSION "v3.21"
#define RSCP2MQTT_VERSION "v3.22"

#define AES_KEY_SIZE 32
#define AES_BLOCK_SIZE 32
Expand Down Expand Up @@ -1485,7 +1485,6 @@ int createRequest(SRscpFrameBuffer * frameBuffer) {
protocol.appendValue(&WBContainer, TAG_WB_REQ_PM_ENERGY_L1);
protocol.appendValue(&WBContainer, TAG_WB_REQ_PM_ENERGY_L2);
protocol.appendValue(&WBContainer, TAG_WB_REQ_PM_ENERGY_L3);
protocol.appendValue(&WBContainer, TAG_WB_REQ_AVAILABLE_SOLAR_POWER);
protocol.appendValue(&rootValue, WBContainer);
protocol.destroyValueData(WBContainer);
}
Expand Down Expand Up @@ -1651,8 +1650,8 @@ int createRequest(SRscpFrameBuffer * frameBuffer) {
sun_mode = getIntegerValue(RSCP_MQTT::RscpMqttCache, TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2) & 128;
max_current = getIntegerValue(RSCP_MQTT::RscpMqttCache, TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 3);
}
for (size_t i = 0; i < sizeof(wallboxExt); ++i) wallboxExt[i] = 0;
if (strstr(it->topic, "control")) { // deprecated
for (size_t i = 0; i < sizeof(wallboxExt); ++i) wallboxExt[i] = 0;
if (sscanf(it->payload, "solar:%d", (int*)&wallboxExt[1]) == 1) {
sun_mode = 1;
} else if (sscanf(it->payload, "mix:%d", (int*)&wallboxExt[1]) == 1) {
Expand All @@ -1664,9 +1663,9 @@ int createRequest(SRscpFrameBuffer * frameBuffer) {
}
} else if (strstr(it->topic, "toggle")) {
wallboxExt[4] = 1;
} else if (strstr(it->topic, "charge")) {
int charging = getIntegerValue(RSCP_MQTT::RscpMqttCache, TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2) & 32;
if ((!charging && !strcmp(it->payload, "1")) || (charging && !strcmp(it->payload, "0"))) {
} else if (strstr(it->topic, "suspended")) {
int suspended = getIntegerValue(RSCP_MQTT::RscpMqttCache, TAG_WB_EXTERN_DATA_ALG, TAG_WB_EXTERN_DATA, 2) & 64;
if ((!suspended && !strcmp(it->payload, "1")) || (suspended && !strcmp(it->payload, "0"))) {
wallboxExt[4] = 1;
}
} else if (strstr(it->topic, "sun_mode")) {
Expand All @@ -1677,7 +1676,7 @@ int createRequest(SRscpFrameBuffer * frameBuffer) {
wallboxExt[0] = sun_mode?1:2;
wallboxExt[1] = max_current;

if (wallboxExt[1] < 0) wallboxExt[1] = 0; else if (wallboxExt[1] > 32) wallboxExt[1] = 32; // max 32A
if (wallboxExt[1] < 1) wallboxExt[1] = 1; else if (wallboxExt[1] > 32) wallboxExt[1] = 32; // max 32A
SRscpValue WBExtContainer;
protocol.createContainerValue(&WBExtContainer, TAG_WB_REQ_SET_EXTERN);
protocol.appendValue(&WBExtContainer, TAG_WB_EXTERN_DATA_LEN, sizeof(wallboxExt));
Expand Down
3 changes: 1 addition & 2 deletions RscpMqttMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ 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 },
Expand Down Expand Up @@ -489,7 +488,7 @@ rec_cache_t rec_cache[] = {
{ 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/suspended", "^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 },
Expand Down
15 changes: 10 additions & 5 deletions TOPICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,11 @@ 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 Available Solar Power | wallbox/available_solar_power | [W] |
| 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 Suspended | e3dc/wallbox/suspended | (true/false) |
| Wallbox Charging | e3dc/wallbox/charging | (true/false) |
| Wallbox Current | e3dc/wallbox/max_current | [A] |
| Wallbox Energy L1 | e3dc/wallbox/energy/L1 | [Wh] |
Expand Down Expand Up @@ -323,9 +322,13 @@ Please find detailled information and examples in the [README](README.md).
| Control the power management (charge from grid in [W], number of cycles) | e3dc/set/power_mode | "grid_charge:2000:60" |
| Wallbox | | |
| Set the active wallbox by index (0..7) | e3dc/set/wallbox/index | (0..7) |
| 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 sun mode | e3dc/set/wallbox/sun_mode | (true/false) |
| Set max current | e3dc/set/wallbox/max_current in [A] | (1..32) |
| Suspend charging | e3dc/set/wallbox/suspended | (true/false) |
| Toggle suspend charging | e3dc/set/wallbox/toggle | true |
| (deprecated) Set solar mode with the current in [A] | e3dc/set/wallbox/control | "solar:16" |
| (deprecated) Set mix mode with the current in [A] | e3dc/set/wallbox/control | "mix:8" |
| (deprecated) Stop charging | e3dc/set/wallbox/control | "stop" |
| 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 | [%] |
Expand All @@ -345,3 +348,5 @@ Please find detailled information and examples in the [README](README.md).
| Enable SOC limiter | e3dc/set/soc_limiter | (true/false) |
| Enable daily historical values | e3dc/set/daily_values | (true/false) |
| Enable statistic values | e3dc/set/statistic_values | (true/false) |

Instead of the values "true" or "false", you can also use "1" or "0".
11 changes: 5 additions & 6 deletions WALLBOX.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ The following topics are sent to the MQTT broker:

| Device / Tag | MQTT Topic | Values / [Unit] |
| --- | --- | --- |
| Wallbox Available Solar Power | wallbox/available_solar_power | [W] |
| 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 Suspended | e3dc/wallbox/suspended | (true/false) |
| Wallbox Charging | e3dc/wallbox/charging | (true/false) |
| Wallbox Current | e3dc/wallbox/max_current | [A] |
| Wallbox Energy L1 | e3dc/wallbox/energy/L1 | [Wh] |
Expand Down Expand Up @@ -66,17 +65,17 @@ Sun Mode (true/1/false/0)
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/sun_mode" -m true
```

Switch charging on/off (true/1/false/0)
Suspend charging (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/charge" -m true
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/suspended" -m true
```

Switching between charging and not charging
Toggle suspend charging
```
mosquitto_pub -h localhost -p 1883 -t"e3dc/set/wallbox/toggle" -m 1
```

Set max current (0..32 A)
Set max current (1..32 A)
```
mosquitto_pub -h localhost -p 1883 -t"e3dc/set/wallbox/max_current" -m 16
```
Expand Down

0 comments on commit 5cf3b0b

Please sign in to comment.