Skip to content

Commit d3b8ba5

Browse files
committed
v3.19
1 parent 00e3980 commit d3b8ba5

File tree

8 files changed

+177
-43
lines changed

8 files changed

+177
-43
lines changed

INFLUXDB.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ INFLUXDB_HOST=localhost
1313
INFLUXDB_PORT=8086
1414
INFLUXDB_VERSION=1
1515
INFLUXDB_MEASUREMENT=e3dc
16+
INFLUXDB_MEASUREMENT_META=e3dc_meta
1617
INFLUXDB_1_DB=e3dc
1718
INFLUXDB_1_AUTH=false
1819
INFLUXDB_1_USER=
@@ -24,6 +25,9 @@ You can configure the topics to be transferred to the InfluxDB by setting the pa
2425
INFLUXDB_TOPIC can occur several times.
2526
If no INFLUXDB_TOPIC configuration exists, all topics will be transferred.
2627

28+
Topics with payload of data types integer or float will be stored to the measurement set by INFLUXDB_MEASUREMENT.
29+
Other topics (strings) will be stored to the measurement set by INFLUXDB_MEASUREMENT_META.
30+
2731
Start the influx client to prepare the database.
2832

2933
Create a database

README.md

Lines changed: 6 additions & 6 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.18]
147+
rscp2mqtt [v3.19]
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-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2621) Connecting to server 192.168.178.111:5033
156-
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2628) Success: E3DC connected.
157-
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(1618) RSCP authentication level 10
158-
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2149) Connecting to broker localhost:1883
159-
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2161) Success: MQTT broker connected.
155+
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2717) Connecting to server 192.168.178.111:5033
156+
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2724) Success: E3DC connected.
157+
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(1688) RSCP authentication level 10
158+
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2221) Connecting to broker localhost:1883
159+
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2233) Success: MQTT broker connected.
160160
```
161161

162162
Check the configuration if the connections are not established.

RELEASE.md

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

3+
### Release v3.19 (14.04.2024)
4+
5+
Bug fixes:
6+
- Issue #55: Improvements to the timeout behavior
7+
- Issue #58: INFLUX_TOPIC wird nicht geschrieben (new measurement for string data)
8+
- Issue #59: Error with e3dc/grid_in_limit_duration
9+
10+
Features:
11+
- Issue #57: Energy per string (today's values)
12+
313
### Release v3.18 (23.03.2024)
414

515
- Issue #53: Power meter summaries

RscpMqttConfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ typedef struct _config_t {
2525
uint32_t influxdb_port;
2626
char influxdb_db[128];
2727
char influxdb_measurement[128];
28+
char influxdb_measurement_meta[128];
2829
bool influxdb_auth;
2930
char influxdb_user[128];
3031
char influxdb_password[128];
@@ -61,6 +62,7 @@ typedef struct _config_t {
6162
bool influxdb_on;
6263
#endif
6364
bool auto_refresh;
65+
bool store_setup;
6466
} config_t;
6567

6668
#endif

RscpMqttMain.cpp

Lines changed: 133 additions & 35 deletions
Large diffs are not rendered by default.

RscpMqttMapping.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
#define IDX_WALLBOX_LAST_ENERGY_SOLAR 18
6262
#define IDX_PM_POWER 100
6363
#define IDX_PM_ENERGY 200
64+
#define IDX_PVI_ENERGY 300
65+
#define IDX_PVI_ENERGY_START 400
6466

6567
namespace RSCP_MQTT {
6668

@@ -112,6 +114,13 @@ typedef struct _date_t {
112114
std::queue<date_t> requestQ;
113115
std::queue<date_t> paramQ;
114116

117+
typedef struct _mqtt_data_t {
118+
char *topic;
119+
char *payload;
120+
} mqtt_data_t;
121+
122+
std::queue<mqtt_data_t> mqttQ;
123+
115124
typedef struct _cache_t {
116125
uint32_t container;
117126
uint32_t tag;
@@ -399,6 +408,8 @@ cache_t templates[] = {
399408
{ TAG_PVI_DC_VOLTAGE, TAG_PVI_VALUE, 1, "pvi/voltage/string_%d", "", F_FLOAT_0, UNIT_V, 1, 0, false, false, false },
400409
{ TAG_PVI_DC_CURRENT, TAG_PVI_VALUE, 1, "pvi/current/string_%d", "", F_FLOAT_2, UNIT_A, 1, 0, false, false, false },
401410
{ TAG_PVI_DC_STRING_ENERGY_ALL, TAG_PVI_VALUE, 1, "pvi/energy_all/string_%d", "", F_FLOAT_0, UNIT_WH, 1, 0, false, false, false },
411+
{ 0, 0, IDX_PVI_ENERGY, "pvi/energy/string_%d", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
412+
{ 0, 0, IDX_PVI_ENERGY_START, "pvi/energy_start/string_%d", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
402413
// PM
403414
{ 0, 0, IDX_PM_POWER, "%s/power", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
404415
{ 0, 0, IDX_PM_ENERGY, "%s/energy", "", F_FLOAT_2, UNIT_KWH, 1, 0, false, false, false },

TOPICS.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,12 @@ All topics are listed with the default prefix "e3dc".
174174
| PVI Energy L1 | e3dc/pvi/energy_all/L1 | [Wh] |
175175
| PVI Energy L2 | e3dc/pvi/energy_all/L2 | [Wh] |
176176
| PVI Energy L3 | e3dc/pvi/energy_all/L3 | [Wh] |
177-
| PVI Energy String1 | e3dc/pvi/energy_all/string_1 | Wh |
178-
| PVI Energy String2 | e3dc/pvi/energy_all/string_2 | Wh |
177+
| PVI Energy String1 (today) | e3dc/pvi/energy/string_1 | Wh |
178+
| PVI Energy String2 (today) | e3dc/pvi/energy/string_2 | Wh |
179+
| PVI Energy String1 (all-time) | e3dc/pvi/energy_all/string_1 | Wh |
180+
| PVI Energy String2 (all-time) | e3dc/pvi/energy_all/string_2 | Wh |
181+
| PVI Energy String1 (midnight) **** | e3dc/pvi/energy_start/string_1 | Wh |
182+
| PVI Energy String2 (midnight) **** | e3dc/pvi/energy_start/string_2 | Wh |
179183
| PVI Frequency | e3dc/pvi/frequency_over | [Hz] |
180184
| PVI Frequency | e3dc/pvi/frequency_under | [Hz] |
181185
| PVI Max Apparent Power L1 | e3dc/pvi/max_apparent_power/L1 | [VA] |
@@ -286,6 +290,8 @@ Energy topics are collected for today, yesterday and the current week, month, ye
286290

287291
***) If more than one power meter exists (PM_INDEX configured multiple times), topics are extended by the number of the power meter
288292

293+
****) The value is required to be able to calculate the daily value. To ensure that the value survives a restart, set RETAIN_FOR_SETUP=true in .config.
294+
289295
### Writeable Topics
290296

291297
Please find detailled information and examples in the [README](README.md).

config.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ HISTORY_START_YEAR=2022
3838
DAILY_VALUES=true
3939
#--Publish statistic values
4040
STATISTIC_VALUES=true
41+
#--Save values as retained topics for setup during restart
42+
RETAIN_FOR_SETUP=true
4143

4244
#-MQTT Topics
4345
#--Topic prefix (max 24 characters), default is e3dc
@@ -93,6 +95,7 @@ INFLUXDB_HOST=localhost
9395
INFLUXDB_PORT=8086
9496
INFLUXDB_VERSION=2
9597
INFLUXDB_MEASUREMENT=e3dc
98+
INFLUXDB_MEASUREMENT_META=e3dc_meta
9699
INFLUXDB_TOPIC=e3dc/[a-z]+/power
97100
INFLUXDB_TOPIC=e3dc/day/.*
98101

0 commit comments

Comments
 (0)