Skip to content

Commit

Permalink
v3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
pvtom committed Nov 26, 2023
1 parent 7e7eda7 commit 6dd705b
Show file tree
Hide file tree
Showing 10 changed files with 771 additions and 317 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
Expand All @@ -31,28 +31,28 @@ jobs:
suffix=${{ matrix.with_influxdb == 'yes' && '-with-influxdb' || '' }}, onlatest=true
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to Github Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
build-args: |
Expand Down
95 changes: 86 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,25 @@ For continuous provision of values, you can configure several topics that are pu

## Features

- (new) Topic prefix is configurable
- Topic prefix is configurable
- E3/DC [wallbox](WALLBOX.md) topics
- [InfluxDB](INFLUXDB.md) support
- Topics for temperatures (battery, PVI)
- Idle periods
- System error messages
- (new) Details of the battery modules (DCB)
- (new) Additional topics for PVI
- (new) Units as InfluxDB tags
- Details of the battery modules (DCB)
- Additional topics for PVI
- Units as InfluxDB tags
- (new) Historical data for past years
- (new) "set/force" for specific topics
- (new) Battery SOC limiter
- Docker image at https://hub.docker.com/r/pvtom/rscp2mqtt

## Docker

Instead of installing the package you can use a [Docker image](DOCKER.md).

## Prerequisite
## Prerequisites

- An MQTT broker in your environment
- rscp2mqtt needs the library libmosquitto. For installation please enter:
Expand Down Expand Up @@ -133,6 +136,13 @@ MQTT_RETAIN=false
PREFIX=e3dc
// log file
LOGFILE=/tmp/rscp2mqtt.log
// history start year (installation of the E3/DC device)
HISTORY_START_YEAR=2021
// log file for selected topics
TOPIC_LOG_FILE=/tmp/rscp2mqtt.history
// selected topics for logging (regular expressions)
TOPIC_LOG=e3dc/history/.*
TOPIC_LOG=e3dc/system/software
// Interval requesting the E3/DC S10 device in seconds (1..10)
INTERVAL=1
// enable PVI requests, default is true
Expand All @@ -145,6 +155,8 @@ PM_REQUESTS=true
PM_EXTERN=false
// enable DCB (details for battery modules) requests, default is true
DCB_REQUESTS=true
// enable battery SOC limiter, default is false
SOC_LIMITER=true
// Auto refresh, default is false
AUTO_REFRESH=false
// Disable MQTT publish support (dryrun mode)
Expand Down Expand Up @@ -226,6 +238,9 @@ The daemon can be terminated with
```
pkill rscp2mqtt
```

## Systemd

Alternatively, `rscp2mqtt` can be managed by systemd. To do this, copy the file `rscp2mqtt.service` to the systemd directory:
```
sudo cp -a rscp2mqtt.service /etc/systemd/system/
Expand Down Expand Up @@ -290,6 +305,60 @@ mosquitto_pub -h localhost -p 1883 -t "e3dc/set/idle_period" -m "today:charge:tr

With the topics "e3dc/ems/charging_lock" and "e3dc/ems/discharging_lock" you can check whether a lock is currently active or not.

### Battery SOC Limiter

The SOC limiter can be used to conveniently control the charging or discharging of the house battery. It uses the Idle Periods described previously.

#### Maximum SOC
When the maximum SOC value is reached, the battery charging process is stopped.

#### Minimum SOC
The battery charge level does not fall below the minimum SOC value. When the SOC is reached, discharging stops.

#### Home Power
When the house power is above the set value, discharging will stop. This can be used, for example, to prevent charging the electric vehicle from the house battery (when using a non-E3/DC wallbox that cannot be controlled directly by the S10 device).

Set the minimum SOC to limit discharging the battery [%]
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/discharge/soc" -m 30
```
Turn off the limiter for discharging the battery
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/discharge/soc" -m 0
```
Set the home power value which stops discharging the battery [W]
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/discharge/by_home_power" -m 7000
```
Reset the home power value which stops discharging the battery
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/discharge/by_home_power" -m 0
```
Reset the limiter at the day change
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/discharge/durable" -m false
```
Keep the limiter setting even after the day change
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/discharge/durable" -m true
```
Set the maximum SOC to limit charging the battery [%]
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/charge/soc" -m 80
```
Turn off the limiter for charging the battery
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/charge/soc" -m 0
```
Reset the limiter at the day change
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/charge/durable" -m false
```
Keep the limiter setting even after the day change
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/limit/charge/durable" -m true
```

### Emergency Power

Set battery reserve for emergency power
Expand Down Expand Up @@ -369,10 +438,14 @@ mosquitto_pub -h localhost -p 1883 -t "e3dc/set/wallbox/disable_battery_at_mix_m

## System Commands

Post all topics and payloads to the MQTT broker again
Refresh all topics
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/force" -m 1
```
Refresh specific topics
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/force" -m "e3dc/history/2021.*"
```
Log all topics and payloads to the log file
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/log" -m 1
Expand All @@ -381,18 +454,22 @@ Set a new refresh interval (1..10 seconds)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/interval" -m 2
```
Set PM requests on or off (true/1/false/0)
Turn PM requests on or off (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/requests/pm" -m true
```
Set PVI requests on or off (true/1/false/0)
Turn PVI requests on or off (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/requests/pvi" -m true
```
Set DCB requests on or off (true/1/false/0)
Turn DCB requests on or off (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/requests/dcb" -m true
```
Turn SOC limiter on or off (true/1/false/0)
```
mosquitto_pub -h localhost -p 1883 -t "e3dc/set/soc_limiter" -m true
```

## Used Libraries and Licenses

Expand Down
10 changes: 10 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Release Notes

### Release v3.8

- Pull requests #23, #24, #25, #26, #27 and #28 (build workflow)
- Historical data for past years
- "set/force" for specific topics
- Battery SOC limiter
- Issue #29: get/set wallbox number of phases
- Issue #32: syntax check for device IP address
4 changes: 4 additions & 0 deletions RscpMqttConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ typedef struct _config_t {
char influxdb_token[128];
#endif
char prefix[25];
int history_start_year;
char *logfile;
char *historyfile;
bool verbose;
int interval;
int battery_string;
bool pvi_requests;
int pvi_tracker;
int pvi_temp_count;
int bat_dcb_count;
bool pm_extern;
bool pm_requests;
bool dcb_requests;
bool soc_limiter;
bool wallbox;
bool daemon;
bool mqtt_pub;
Expand Down
Loading

0 comments on commit 6dd705b

Please sign in to comment.