Skip to content

Commit f29b7f5

Browse files
committed
v3.38
1 parent cceb288 commit f29b7f5

File tree

10 files changed

+621
-338
lines changed

10 files changed

+621
-338
lines changed

CONFIG.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
## Configuration
2+
3+
rscp2mqtt offers the option for setting configuration parameters by a config file named .config.
4+
5+
Starting with release v3.38 configuration can also be set via environment variables. This simplifies the start of a Docker container, as no .config file is required.
6+
7+
If you use both, the environment variables overwrite the parameters set with .config! (Exception: parameters that can be set multiple times).
8+
9+
### Configuration E3/DC and MQTT Broker
10+
11+
| Key | Value/Range | Example |
12+
| --- | --- | --- |
13+
| E3DC_IP | string | 192.168.178.11 |
14+
| E3DC_PORT | 0 - 65535 | 5033 |
15+
| E3DC_USER | string | [email protected] |
16+
| E3DC_PASSWORD | string | mypwd |
17+
| E3DC_AES_PASSWORD | string | myaespwd |
18+
| MQTT_HOST | string | localhost |
19+
| MQTT_PORT | 0 - 65535 | 1883 |
20+
| MQTT_USER | string | |
21+
| MQTT_PASSWORD | string | |
22+
| MQTT_AUTH | true/false | false |
23+
| MQTT_TLS_CAFILE | string | /home/pi/ca.crt |
24+
| MQTT_TLS_CAPATH | string | |
25+
| MQTT_TLS_CERTFILE | string | /home/pi/client.crt |
26+
| MQTT_TLS_KEYFILE | string | /home/pi/client.key |
27+
| MQTT_TLS_PASSWORD | string | |
28+
| MQTT_TLS | true/false | false |
29+
| MQTT_RETAIN | true/false | false |
30+
| MQTT_QOS | 0 - 2 | 0 |
31+
| PREFIX | string | e3dc |
32+
33+
### Configuration Output Values
34+
35+
| Key | Value/Range | Example |
36+
| --- | --- | --- |
37+
| AUTO_REFRESH | true/false | false |
38+
| BATTERY_STRINGS | integer | 1 |
39+
| DAILY_VALUES | true/false | false |
40+
| DCB_REQUESTS | true/false | true |
41+
| EMS_REQUESTS | true/false | true |
42+
| FORCE_PUB * | string | e3dc/[a-z]+/power |
43+
| HISTORY_START_YEAR | integer | 2024 |
44+
| HST_REQUESTS | true/false | true |
45+
| INTERVAL | integer | 4 |
46+
| LIMIT_CHARGE_SOC | 0 - 100 | 0 |
47+
| LIMIT_DISCHARGE_SOC | 0 - 100 | 0 |
48+
| LIMIT_CHARGE_DURABLE | true/false | false |
49+
| LIMIT_DISCHARGE_DURABLE | true/false | false |
50+
| LIMIT_DISCHARGE_BY_HOME_POWER | 0 - 99999 | 0 |
51+
| PM_EXTERN | true/false | false |
52+
| PM_INDEX | integer | 0 |
53+
| PM_REQUESTS | true/false | true |
54+
| PVI_TRACKER | integer | 0 |
55+
| RAW_MODE | true/false | true |
56+
| RAW_TOPIC_REGEX | string | |
57+
| RETAIN_FOR_SETUP | true/false | true |
58+
| SOC_LIMITER | true/false | false |
59+
| STATISTIC_VALUES | true/false | true |
60+
| USE_TRUE_FALSE | true/false | false |
61+
| VERBOSE | true/false | false |
62+
| WALLBOX | true/false | false |
63+
| WB_INDEX | integer | 0 |
64+
65+
*) Multiple FORCE_PUB and INFLUXDB_TOPIC
66+
67+
The parameters FORCE_PUB and INFLUXDB_TOPIC can be set multiple times in the configuration file.
68+
This is not possible via environment variables, as the values would be overwritten. Therefore, please use FORCE_PUB_01, FORCE_PUB_02, INFLUXDB_TOPIC_01, INFLUXDB_TOPIC_02, INFLUXDB_TOPIC_03 etc.
69+
70+
### InfluxDB
71+
72+
| Key | Value/Range | Example |
73+
| --- | --- | --- |
74+
| ENABLE_INFLUXDB | true/false | false |
75+
| INFLUXDB_TOPIC * | string | e3dc/system/.* |
76+
77+
### Configuration for InfluxDB v1.x
78+
79+
| Key | Value/Range | Example |
80+
| --- | --- | --- |
81+
| INFLUXDB_HOST | string | localhost |
82+
| INFLUXDB_PORT | 0 - 65535 | 8086 |
83+
| INFLUXDB_VERSION | integer | 1 |
84+
| INFLUXDB_1_DB | string | e3dc |
85+
| INFLUXDB_1_USER | string | |
86+
| INFLUXDB_1_PASSWORD | string | |
87+
| INFLUXDB_1_AUTH | true/false | false |
88+
89+
### Configuration for InfluxDB v2.x
90+
91+
| Key | Value/Range | Example |
92+
| --- | --- | --- |
93+
| INFLUXDB_2_ORGA | string | |
94+
| INFLUXDB_2_BUCKET | string | |
95+
| INFLUXDB_2_TOKEN | string | |
96+
| INFLUXDB_MEASUREMENT | string | e3dc |
97+
| INFLUXDB_MEASUREMENT_META | string | e3dc_meta |
98+
99+
### Configuration for InfluxDB SSL
100+
101+
| Key | Value/Range | Example |
102+
| --- | --- | --- |
103+
| CURL_HTTPS | true/false | false |
104+
| CURL_OPT_SSL_VERIFYPEER | true/false | true |
105+
| CURL_OPT_SSL_VERIFYHOST | true/false | true |
106+
| CURL_OPT_CAINFO | string | |
107+
| CURL_OPT_SSLCERT | string | |
108+
| CURL_OPT_SSLKEY | string | |
109+
110+
### Hints
111+
112+
The prefix of the topics can be configured by the attribute PREFIX. By default all topics start with "e3dc". This can be changed to any other string that MQTT accepts as a topic, max. 24 characters. E.g. "s10" or "s10/1".
113+
114+
If your system has more than one battery string (e.g. S10 Pro), you have to configure the parameter BATTERY_STRINGS accordingly.
115+
Battery topics that belong to a battery string are extended by the number of the battery string.
116+
Battery modules (DCB topics) are numbered consecutively.
117+
118+
Logging can be configured for messages that the home power station output in response to a request.
119+
Messages are collected including a counter for the number of occurrences.
120+
The errors will be logged in a bundle at midnight, at the end of the program or by querying with e3dc/set/log/errors.
121+
This reduces the number of error messages.
122+
To do this, set in the .config file: `LOG_MODE=BUFFERED`.
123+
You can also switch off the logging of such messages completely with `LOG_MODE=OFF`.
124+
If every event is to be logged: `LOG_MODE=ON`.

DOCKER.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@ A Docker image is available at https://hub.docker.com/r/pvtom/rscp2mqtt
44

55
### Configuration
66

7-
Create a config file as described in the [Readme](README.md).
7+
- Create a config file as described in the [Readme](README.md) or
8+
- Set the parameters by -e KEY=VALUE ([Config](CONFIG.md))
89

910
### Start the docker container
1011

1112
```
13+
docker run --rm -e TZ=Europe/Berlin -e E3DC_IP=<IP> -e E3DC_USER=<your user> -e E3DC_PASSWORD=<your password -e E3DC_AES_PASSWORD=<your AES password> -e MQTT_HOST=<MQTT broker> pvtom/rscp2mqtt:latest
14+
15+
# or with .config
1216
docker run -e TZ=Europe/Berlin --rm -v /path/to/your/.config:/opt/rscp2mqtt/.config pvtom/rscp2mqtt:latest
1317
```
1418

1519
### Start the docker container including InfluxDB support
1620

1721
```
22+
docker run --rm -e TZ=Europe/Berlin -e E3DC_IP=<IP> -e E3DC_USER=<your user> -e E3DC_PASSWORD=<your password -e E3DC_AES_PASSWORD=<your AES password> -e MQTT_HOST=<MQTT broker> -e ENABLE_INFLUXDB=true -e INFLUXDB_HOST=<host name> -e INFLUXDB_VERSION=1 -e INFLUXDB_1_DB=<db name> pvtom/rscp2mqtt:latest-with-influxdb
23+
24+
# or with .config
1825
docker run -e TZ=Europe/Berlin --rm -v /path/to/your/.config:/opt/rscp2mqtt/.config pvtom/rscp2mqtt:latest-with-influxdb
1926
```
2027

Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ RUN make WITH_INFLUXDB=${with_influxdb}
1818

1919
RUN mkdir -p /opt/rscp2mqtt
2020
RUN cp -a rscp2mqtt /opt/rscp2mqtt
21-
RUN cp config.template /opt/rscp2mqtt/.config
21+
RUN cp -a startup.sh /opt/rscp2mqtt
22+
RUN cp -a config.min /opt/rscp2mqtt
2223
RUN chown -R nobody:99 /opt/rscp2mqtt
2324

2425
FROM alpine
25-
RUN apk --no-cache add tzdata libstdc++ mosquitto-libs libcurl
26+
RUN apk --no-cache add \
27+
tzdata \
28+
bash \
29+
libstdc++ \
30+
mosquitto-libs \
31+
libcurl
32+
2633
COPY --from=0 /opt/rscp2mqtt /opt/rscp2mqtt
2734

2835
# Switch to use a non-root user from here on
2936
USER nobody
3037

3138
WORKDIR /opt/rscp2mqtt
3239

33-
CMD ["/opt/rscp2mqtt/rscp2mqtt"]
40+
CMD ["/bin/bash","-c","./startup.sh"]

README.md

Lines changed: 24 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,36 @@
66
[![GitHub pull requests](https://img.shields.io/github/issues-pr/pvtom/rscp2mqtt)](https://github.com/pvtom/rscp2mqtt/pulls)
77
[![GitHub](https://img.shields.io/github/license/pvtom/rscp2mqtt)](https://github.com/pvtom/rscp2mqtt/blob/main/LICENSE)
88

9-
This software module connects a home power station from E3/DC to an MQTT broker.
9+
This software module connects a home power station from E3/DC with an MQTT broker. There is also a version that can store data in an InfluxDB.
1010

1111
It uses the RSCP interface of the device. The solution is based on the RSCP sample application provided by E3/DC and was developed and tested with a Raspberry Pi, a Linux PC (x86_64) and an Apple MacBook (x86_64).
1212

13-
The tool cyclically queries data from the home power station and publishes it to an MQTT broker using these [topics](TOPICS.md).
13+
The tool cyclically queries data from the home power station and publishes it to the MQTT broker (and the InfluxDB) using these [topics](TOPICS.md).
1414

15-
Supported topic areas are:
15+
It subscribes to the root topic "e3dc/set/#" and forwards incoming requests to the home power station. In this way, the device can be controlled, additional data can be queried and changes can be made to its configuration.
1616

17-
- Energy topics for today
18-
- Current power values
19-
- Autarky and self-consumption
20-
- Battery status
21-
- Energy management (EMS) power settings
22-
- Data from yesterday and the current week, month and year
23-
- Values of the power meter (PM)
24-
- Values of the photovoltaic inverter (PVI)
25-
- Values of the emergency power supply (EP)
26-
- Values of wallboxes (WB)
27-
28-
For continuous provision of values, you can configure several topics that are published in each cycle. Default: Only modified values will be published.
17+
Please also take a look at the [release notes](RELEASE.md).
2918

3019
## Features
3120

32-
- E3/DC [wallbox](WALLBOX.md) topics
21+
- E3/DC [wallbox](WALLBOX.md) support
3322
- [InfluxDB](INFLUXDB.md) support
34-
- Topics for temperatures (battery, PVI)
35-
- Idle periods
36-
- System error messages
37-
- Details of the battery modules (DCB)
38-
- Units as InfluxDB tags
3923
- Battery SOC limiter
40-
- Docker images at https://hub.docker.com/r/pvtom/rscp2mqtt
4124
- [Dashboard](https://github.com/pvtom/rscp2mqtt-dashboard) is available
42-
- Configuration of the topics that will be published to InfluxDB (INFLUXDB_TOPIC)
43-
- Multiple battery strings are supported (BATTERY_STRINGS parameter)
44-
- Automatic detection of the number of PVI trackers
4525
- Historical data for past years
4626
- Query of historical daily values
47-
- Multiple power meters
48-
- Multiple wallboxes
4927
- TLS connections ([MQTT broker](MQTT_TLS.md), [InfluxDB](INFLUXDB.md))
50-
- [Additional tags and topics](NEWTAGS.md) by configuration
51-
- Raw data mode
52-
53-
Please also take a look at the [release notes](RELEASE.md).
28+
- [Additional tags and topics](NEWTAGS.md) by configuration and raw data mode
5429

5530
## Docker
5631

5732
Instead of installing the package you can use a [Docker image](DOCKER.md) for Linux platforms (not MacOS).
5833

59-
## Prerequisites
34+
## Local Installation
35+
36+
If the software is to be installed locally rather than via Docker, carry on the following steps:
37+
38+
### Prerequisites
6039

6140
- An MQTT broker in your environment
6241
- rscp2mqtt needs the library libmosquitto. For installation please enter:
@@ -75,15 +54,15 @@ On MacOS try
7554
brew install mosquitto curl
7655
```
7756

78-
## Cloning the Repository
57+
### Cloning the Repository
7958

8059
```
8160
sudo apt-get install git # if necessary
8261
git clone https://github.com/pvtom/rscp2mqtt.git
8362
cd rscp2mqtt
8463
```
8564

86-
## Compilation
65+
### Compilation
8766

8867
To build a program version without InfluxDB use:
8968
```
@@ -95,7 +74,7 @@ To build a program version including InfluxDB support use:
9574
make WITH_INFLUXDB=yes
9675
```
9776

98-
## Installation
77+
### Installation
9978

10079
```
10180
sudo mkdir -p /opt/rscp2mqtt
@@ -111,6 +90,10 @@ cp -a rscp2mqtt /opt/rscp2mqtt
11190

11291
## Configuration
11392

93+
The tool can be configured in two ways.
94+
95+
### Configuration via Config File
96+
11497
Copy the config template file into the directory `/opt/rscp2mqtt`
11598
```
11699
cp config.template /opt/rscp2mqtt/.config
@@ -124,27 +107,14 @@ nano .config
124107
```
125108
The configuration parameters are described in the file.
126109

127-
The prefix of the topics can be configured by the attribute PREFIX. By default all topics start with "e3dc". This can be changed to any other string that MQTT accepts as a topic, max. 24 characters. E.g. "s10" or "s10/1".
128-
129-
If your system has more than one battery string (e.g. S10 Pro), you have to configure the parameter BATTERY_STRINGS accordingly.
130-
Battery topics that belong to a battery string are extended by the number of the battery string.
131-
Battery modules (DCB topics) are numbered consecutively.
132-
133-
Find InfluxDB configurations in [InfluxDB](INFLUXDB.md).
134-
135-
The parameter FORCE_PUB can occur several times. You can use it to define topics that will be published in each cycle, even if the values do not change. To check the definition, look at the log output after the program start.
110+
### Configuration via Environment Variables
136111

137-
Logging can be configured for messages that the home power station output in response to a request.
138-
Messages are collected including a counter for the number of occurrences.
139-
The errors will be logged in a bundle at midnight, at the end of the program or by querying with e3dc/set/log/errors.
140-
This reduces the number of error messages.
141-
To do this, set in the .config file: `LOG_MODE=BUFFERED`.
142-
You can also switch off the logging of such messages completely with `LOG_MODE=OFF`.
143-
If every event is to be logged: `LOG_MODE=ON`.
112+
Program parameters can also be set via environment variables. This simplifies the start of a Docker container, as no .config file is required.
113+
Please find more [here](CONFIG.md).
144114

145115
## Program Start
146116

147-
Start the program:
117+
Program start if the tool has been installed locally:
148118
```
149119
./rscp2mqtt
150120
```
@@ -160,7 +130,7 @@ or to show the help page
160130
If everything works properly, you will see something like this:
161131

162132
```
163-
rscp2mqtt [3.37]
133+
rscp2mqtt [3.38]
164134
E3DC system >192.168.178.111:5033< user: >your E3DC user<
165135
MQTT broker >localhost:1883< qos = >0< retain = >✗< tls >✗< client id >✗< prefix >e3dc<
166136
Requesting PVI ✓ | PM (0) | DCB ✓ (1 battery string) | Wallbox ✗ | Interval 2 | Autorefresh ✓ | Raw data ✗ | Logging OFF
@@ -241,7 +211,7 @@ mosquitto_pub -h localhost -p 1883 -t "e3dc/set/discharge_start_power" -m 65
241211

242212
### Idle Periods
243213

244-
Set idle periods to lock battery charging or discharging
214+
Set idle periods to lock battery charging or discharging.
245215

246216
Note: The set operations will work only if the idle period functionality is turned on (via the S10 display).
247217

RELEASE.md

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

3+
### Release v3.38 (06.07.2025)
4+
5+
Features:
6+
- Configuration via environment variables, e.g. to simplify the start of a Docker container
7+
38
### Release v3.37 (12.04.2025)
49

510
Bug fixes:
@@ -8,6 +13,8 @@ Bug fixes:
813

914
### Release v3.36 (29.03.2025)
1015

16+
Use not recommended due to existing errors!
17+
1118
Features:
1219
- Issue #103: Battery module cell information (voltage and temperature)
1320

@@ -63,6 +70,8 @@ Bug fixes:
6370

6471
### Release v3.26 (14.07.2024)
6572

73+
Use not recommended due to existing errors!
74+
6675
Features:
6776
- Issue #76: Multiple wallboxes
6877
- Additional tags and topics by configuration

0 commit comments

Comments
 (0)