Skip to content

Commit

Permalink
v3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
pvtom committed Apr 14, 2024
1 parent 00e3980 commit d3b8ba5
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 43 deletions.
4 changes: 4 additions & 0 deletions INFLUXDB.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ INFLUXDB_HOST=localhost
INFLUXDB_PORT=8086
INFLUXDB_VERSION=1
INFLUXDB_MEASUREMENT=e3dc
INFLUXDB_MEASUREMENT_META=e3dc_meta
INFLUXDB_1_DB=e3dc
INFLUXDB_1_AUTH=false
INFLUXDB_1_USER=
Expand All @@ -24,6 +25,9 @@ You can configure the topics to be transferred to the InfluxDB by setting the pa
INFLUXDB_TOPIC can occur several times.
If no INFLUXDB_TOPIC configuration exists, all topics will be transferred.

Topics with payload of data types integer or float will be stored to the measurement set by INFLUXDB_MEASUREMENT.
Other topics (strings) will be stored to the measurement set by INFLUXDB_MEASUREMENT_META.

Start the influx client to prepare the database.

Create a database
Expand Down
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.18]
rscp2mqtt [v3.19]
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-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2621) Connecting to server 192.168.178.111:5033
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2628) Success: E3DC connected.
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(1618) RSCP authentication level 10
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2149) Connecting to broker localhost:1883
[2024-03-23 10:00:00] pid=30180 ppid=1 RscpMqttMain.cpp(2161) Success: MQTT broker connected.
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2717) Connecting to server 192.168.178.111:5033
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2724) Success: E3DC connected.
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(1688) RSCP authentication level 10
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2221) Connecting to broker localhost:1883
[2024-04-14 10:00:00] pid=30190 ppid=1 RscpMqttMain.cpp(2233) Success: MQTT broker connected.
```

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

### Release v3.19 (14.04.2024)

Bug fixes:
- Issue #55: Improvements to the timeout behavior
- Issue #58: INFLUX_TOPIC wird nicht geschrieben (new measurement for string data)
- Issue #59: Error with e3dc/grid_in_limit_duration

Features:
- Issue #57: Energy per string (today's values)

### Release v3.18 (23.03.2024)

- Issue #53: Power meter summaries
Expand Down
2 changes: 2 additions & 0 deletions RscpMqttConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ typedef struct _config_t {
uint32_t influxdb_port;
char influxdb_db[128];
char influxdb_measurement[128];
char influxdb_measurement_meta[128];
bool influxdb_auth;
char influxdb_user[128];
char influxdb_password[128];
Expand Down Expand Up @@ -61,6 +62,7 @@ typedef struct _config_t {
bool influxdb_on;
#endif
bool auto_refresh;
bool store_setup;
} config_t;

#endif
168 changes: 133 additions & 35 deletions RscpMqttMain.cpp

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions RscpMqttMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
#define IDX_WALLBOX_LAST_ENERGY_SOLAR 18
#define IDX_PM_POWER 100
#define IDX_PM_ENERGY 200
#define IDX_PVI_ENERGY 300
#define IDX_PVI_ENERGY_START 400

namespace RSCP_MQTT {

Expand Down Expand Up @@ -112,6 +114,13 @@ typedef struct _date_t {
std::queue<date_t> requestQ;
std::queue<date_t> paramQ;

typedef struct _mqtt_data_t {
char *topic;
char *payload;
} mqtt_data_t;

std::queue<mqtt_data_t> mqttQ;

typedef struct _cache_t {
uint32_t container;
uint32_t tag;
Expand Down Expand Up @@ -399,6 +408,8 @@ cache_t templates[] = {
{ TAG_PVI_DC_VOLTAGE, TAG_PVI_VALUE, 1, "pvi/voltage/string_%d", "", F_FLOAT_0, UNIT_V, 1, 0, false, false, false },
{ TAG_PVI_DC_CURRENT, TAG_PVI_VALUE, 1, "pvi/current/string_%d", "", F_FLOAT_2, UNIT_A, 1, 0, false, false, false },
{ 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 },
{ 0, 0, IDX_PVI_ENERGY, "pvi/energy/string_%d", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
{ 0, 0, IDX_PVI_ENERGY_START, "pvi/energy_start/string_%d", "", F_AUTO, UNIT_WH, 1, 0, false, false, false },
// PM
{ 0, 0, IDX_PM_POWER, "%s/power", "", F_FLOAT_0, UNIT_W, 1, 0, false, false, false },
{ 0, 0, IDX_PM_ENERGY, "%s/energy", "", F_FLOAT_2, UNIT_KWH, 1, 0, false, false, false },
Expand Down
10 changes: 8 additions & 2 deletions TOPICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ All topics are listed with the default prefix "e3dc".
| PVI Energy L1 | e3dc/pvi/energy_all/L1 | [Wh] |
| PVI Energy L2 | e3dc/pvi/energy_all/L2 | [Wh] |
| PVI Energy L3 | e3dc/pvi/energy_all/L3 | [Wh] |
| PVI Energy String1 | e3dc/pvi/energy_all/string_1 | Wh |
| PVI Energy String2 | e3dc/pvi/energy_all/string_2 | Wh |
| PVI Energy String1 (today) | e3dc/pvi/energy/string_1 | Wh |
| PVI Energy String2 (today) | e3dc/pvi/energy/string_2 | Wh |
| PVI Energy String1 (all-time) | e3dc/pvi/energy_all/string_1 | Wh |
| PVI Energy String2 (all-time) | e3dc/pvi/energy_all/string_2 | Wh |
| PVI Energy String1 (midnight) **** | e3dc/pvi/energy_start/string_1 | Wh |
| PVI Energy String2 (midnight) **** | e3dc/pvi/energy_start/string_2 | Wh |
| PVI Frequency | e3dc/pvi/frequency_over | [Hz] |
| PVI Frequency | e3dc/pvi/frequency_under | [Hz] |
| PVI Max Apparent Power L1 | e3dc/pvi/max_apparent_power/L1 | [VA] |
Expand Down Expand Up @@ -286,6 +290,8 @@ Energy topics are collected for today, yesterday and the current week, month, ye

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

****) 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.

### Writeable Topics

Please find detailled information and examples in the [README](README.md).
Expand Down
3 changes: 3 additions & 0 deletions config.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ HISTORY_START_YEAR=2022
DAILY_VALUES=true
#--Publish statistic values
STATISTIC_VALUES=true
#--Save values as retained topics for setup during restart
RETAIN_FOR_SETUP=true

#-MQTT Topics
#--Topic prefix (max 24 characters), default is e3dc
Expand Down Expand Up @@ -93,6 +95,7 @@ INFLUXDB_HOST=localhost
INFLUXDB_PORT=8086
INFLUXDB_VERSION=2
INFLUXDB_MEASUREMENT=e3dc
INFLUXDB_MEASUREMENT_META=e3dc_meta
INFLUXDB_TOPIC=e3dc/[a-z]+/power
INFLUXDB_TOPIC=e3dc/day/.*

Expand Down

0 comments on commit d3b8ba5

Please sign in to comment.