pvtom / rscp2mqtt Goto Github PK
View Code? Open in Web Editor NEWBridge between an E3/DC home power station and an MQTT broker based on the RSCP protocol
License: MIT License
Bridge between an E3/DC home power station and an MQTT broker based on the RSCP protocol
License: MIT License
Hallo,
das Topic e3dc/system/software wird nicht in die InfluxDB geschrieben, ebenso die Topics
e3dc/system/inverter_count,
e3dc/system/serial_number,
e3dc/system/production_date,
e3dc/system/software
Ist das so gewollt?
Gruß Sven
Hallo Thomas,
bei den Historischen Werten fehlen bei allen Zeiträumen der Wert für die externe Quelle.
Kannst du das noch ergänzen?
Danke & Grüße
Philipp
e3dc/grid_in_limit_duration is no longer calculated since release v3.18. The calculation of the wallbox values for the last charge is also affected.
Hi,
thanks for providing this great tool. I'm running it for a couple of hours and noted the following log entry:
Error: Tag 0x05840000 received error code 6.
{"code":"invalid","message":"unable to parse 'e3dc,topic=e3dc/system/software value=S10_2022_046': invalid boolean\nunable to parse 'e3dc,topic=e3dc/system/production_date value=KW46 2020': invalid boolean\nunable to parse 'e3dc,topic=e3dc/system/serial_number value=XXXXXXXX': invalid boolean\nunable to parse 'e3dc,topic=e3dc/time/zone value=Europe/Berlin': invalid boolean"}{"code":"invalid","message":"unable to parse 'e3dc,topic=e3dc/battery/name value=LG_BAT': invalid boolean"}[2023-06-25 22:09:19] pid=1 ppid=0 RscpMqttMain.cpp(789) Error: Tag 0x05840000 received error code 6.
I removed the serial number from the bug report. It doesn't seem to hurt much as it seems to provide most of the data I was looking for. But maybe you want to investigate / fix it .
In case of any questions, please let me know.
Is it possible to implement higher Values for Set limits ?
The Pro Series supports up to 12000W in Charging and Discharging.
The same whit the manual Loading, there are also 12000Wh supported.
Hallo,
ich habe leider keine weiteren Informationen zum Parameter battery_discharge_until
für die Wallbox gefunden. Meine Tests ergaben, dass beim Erreichen des Batterielevels das Laden des Autos unterbrochen wird. Wenn man mit Überschuss lädt, dann wird sich die Batterie wieder aufladen.
Was passiert beim Erreichen der eingestellten Schwelle? Wird das Laden beendet und muss dann durch eine gesonderte Aktion wieder getriggert werden?
Vielen Dank!
Hi,
both type are without function because there a typos...
--- RscpMqttMapping.h.org 2023-05-20 13:30:03.556207343 +0200
+++ RscpMqttMapping.h 2023-05-20 13:34:38.316840030 +0200
@@ -206,8 +206,8 @@
{ TAG_SE_REQ_SET_EP_RESERVE, TAG_SE_PARAM_EP_RESERVE, "e3dc/set/reserve/percent", PAYLOAD_REGEX_2_DIGIT, "", "", "", "", RSCP::eTypeFloat32, -1, true },
{ TAG_SE_REQ_SET_EP_RESERVE, TAG_SE_PARAM_EP_RESERVE_W, "e3dc/set/reserve/energy", PAYLOAD_REGEX_5_DIGIT, "", "", "", "", RSCP::eTypeFloat32, -1, true },
{ 0, 0, "e3dc/set/power_mode", "^auto$|^idle:[0-9]{1,4}$|^charge:[0-9]{1,5}:[0-9]{1,4}$|^discharge:[0-9]{1,5}:[0-9]{1,4}$|^grid_charge:[0-9]{1,5}:[0-9]{1,4}$", "", "", "", "", RSCP::eTypeBool, -1, true },
- { 0, TAG_EMS_BATTERY_TO_CAR_MODE, "e3dc/set/wallbox/battery_to_car", "^true|on|1$", "1", "^false|off|0$", "0", "", RSCP::eTypeUChar8, -1, true },
- { 0, TAG_EMS_BATTERY_BEFORE_CAR_MODE, "e3dc/set/wallbox/battery_before_car", "^true|on|1$", "1", "^false|off|0$", "0", "", RSCP::eTypeUChar8, -1, true },
+ { 0, TAG_EMS_REQ_SET_BATTERY_TO_CAR_MODE, "e3dc/set/wallbox/battery_to_car", "^true|on|1$", "1", "^false|off|0$", "0", "", RSCP::eTypeUChar8, -1, true },
+ { 0, TAG_EMS_REQ_SET_BATTERY_BEFORE_CAR_MODE, "e3dc/set/wallbox/battery_before_car", "^true|on|1$", "1", "^false|off|0$", "0", "", RSCP::eTypeUChar8, -1, true },
{ TAG_WB_REQ_DATA, TAG_WB_EXTERN_DATA, "e3dc/set/wallbox/control", "^solar:[0-9]{1,2}$|^mix:[0-9]{1,2}$|^stop$", "", "", "", "", RSCP::eTypeBool, -1, true },
{ 0, 0, "e3dc/set/requests/pm", "^true|1$", "true", "^false|0$", "false", "", RSCP::eTypeBool, -1, true },
{ 0, 0, "e3dc/set/requests/pvi", "^true|1$", "true", "^false|0$", "false", "", RSCP::eTypeBool, -1, true },
Best Regards
Hi there again,
sorry to come up with another issue. I am wondering about the topic e3dc/battery/soc changing to 0 every 13 min 20 s (nearly exactly, plus/minus a few seconds). It is looking a bit strange in Home Assistant (the lower graph in the following picture).
This issue is not a new one - but until now I suspected the reason to be in Home Assistant. Only since I did some analytics of the mqtt messages I found out that it seems to be rscp2mqtt related. This behaviour can only be observed while there is no solar power (e3dc/solar/power = 0). Or in other words: As soon as the sun is shining there are no jumps in the soc value, visible on the left side of the diagram screenshot.
As well, after upgrading to v3.12 I noticed that e3dc/battery/rsoc is changing from the rsoc to the soc value from time to time (that is the upper graph) - and vice versa (and this behaviour is new with v3.12). I checked the values with RSCPGui, also refreshed the values at that moment when e3dc/battery/soc changed to zero (that was for about 1-3 intervals with INTERVAL=3, then back to the correct value). RSCPGui does not show these jumps, even if I force updates as soon as I observe the value jumps via mqtt. Weirdly, before upgrading rscp2mqtt, the rsoc value was always identical to the soc value - only that the rsoc value had one decimal (i.e. 23.5%) while soc always are published as integer value (i.e. 23 %).
I did not dive into the source code too deeply (since I am not a skilled programmer) but possibly there is a double definition of some mqtt topics in RscpMqttMapping.h in block
// CONTAINER TAG_DB_HISTORY_DATA_...
// TODAY
(Possibly in that block there is a missing "today/" prefix in the mqtt topics? But could not find anything in parallel to this regarding the soc jumps).
Best regards
Happy New Year, too!
No really an issue, but an extension (I'm a bit left handed using git pull requests...).
Started using RSCP2MQTT only a few hours ago and found it really great; this is exactly what I was looking for :-)
Hence I created a systemd service to auto-start it on my RPi:
[Unit]
Description=RSCP2MQTT service
After=network.target
After=systemd-user-sessions.service
After=network-online.target
[Service]
User=pi
Type=forking
WorkingDirectory=/opt/rscp2mqtt
ExecStart=/opt/rscp2mqtt/rscp2mqtt -d
ExecStop=pkill rscp2mqtt
TimeoutSec=30
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=multi-user.target
Maybe helpful to others :-)
Create as 'rscp2mqtt.service' in '/etc/systemd/system/'
Config with 'sudo nano rscp2mqtt.service' (adjust USER 'User'=pi, if needed)
Start: sudo systemctl start rscp2mqtt
Install: sudo systemctl enable rscp2mqtt
Hi Thomas,
thanks for that nice project.
I would like to block battery discharge when my car is being charged. Is there a set command to lock battery discharged?
Or do you have another idea how to solve this?
BR Andreas
Hi there,
I'm using rscp2mqtt with an S10E, latest firmware (Q4/2023). Until rscp2mqtt v3.9 everything works fine. But from 3.10 the second PVI tracker is no longer delivering values other than zero - 0 voltage, 0 current and 0 power on the 2nd string (which is forced to be published by "FORCE_PUB=e3dc/pvi/.*/string_[1,2]" in .config).
Since PVI_TRACKER in .config does not seem to work any longer, I'm missing the second string with >=v3.10. You probably aim to get the autodetection to work - but may I suggest: If PVI_TRACKER is not defined in .config, rscp2mqtt tries auto detection, but if it's defined, it overrides auto detection?
Your great work is very much appreciated!
Hi Tom,
probiere mal wieder... bin jetzt erstmal ohne Docker unterwegs. Funktioniert soweit, ich bekomme nur ab und an Timeouts.. kannst Du sagen, was den Timeout erzeugt (e3dc, influx etc?)
pi@sturmserver:/opt/rscp2mqtt $ ./rscp2mqtt
rscp2mqtt [v3.19]
E3DC system >192.168.178.58:5033< user: >Timmo.Sturm<
MQTT broker >localhost:1883< qos = >0< retain = >false< client id >✗< prefix >e3dc<
Fetching data every 10 seconds.
Requesting PVI ✓ | PM (0) | DCB ✓ (1 battery string) | Wallbox (0) ✓ | Autorefresh ✗
Log level = 1
Stdout to terminal
[2024-04-14 13:12:23] pid=1067620 ppid=982363 RscpMqttMain.cpp(2717) Connecting to server 192.168.178.58:5033
[2024-04-14 13:12:23] pid=1067620 ppid=982363 RscpMqttMain.cpp(2724) Success: E3DC connected.
[2024-04-14 13:12:23] pid=1067620 ppid=982363 RscpMqttMain.cpp(1688) RSCP authentication level 10
[2024-04-14 13:12:23] pid=1067620 ppid=982363 RscpMqttMain.cpp(2221) Connecting to broker localhost:1883
[2024-04-14 13:12:23] pid=1067620 ppid=982363 RscpMqttMain.cpp(2233) Success: MQTT broker connected.
[2024-04-14 13:12:23] pid=1067620 ppid=982363 RscpMqttMain.cpp(345) MQTT: starting listener loop
[2024-04-14 13:12:24] pid=1067620 ppid=982363 RscpMqttMain.cpp(1806) Error: Container 0x02840000 Tag 0x02000060 received error code 6.
[2024-04-14 13:12:24] pid=1067620 ppid=982363 RscpMqttMain.cpp(1806) Error: Container 0x02840000 Tag 0x02000070 received error code 6.
[2024-04-14 13:12:24] pid=1067620 ppid=982363 RscpMqttMain.cpp(1806) Error: Container 0x02840000 Tag 0x02000080 received error code 6.
[2024-04-14 13:12:28] pid=1067620 ppid=982363 RscpMqttMain.cpp(2100) Error: Response receive timeout (retry)
[2024-04-14 13:12:32] pid=1067620 ppid=982363 RscpMqttMain.cpp(2100) Error: Response receive timeout (retry)
meine config:
#-E3DC Access
#--IP address and port of your home power station
E3DC_IP=192.168.178.58
E3DC_PORT=5033
#--your E3/DC web account and the RSCP/AES password configured in the device (Issue #31)
E3DC_USER={private}
E3DC_PASSWORD={private}
E3DC_AES_PASSWORD={private}
#-MQTT Broker
#--Name or IP address and port of your MQTT broker
MQTT_HOST=localhost
MQTT_PORT=1883
#--MQTT parameters
MQTT_CLIENT_ID=
MQTT_QOS=0
MQTT_RETAIN=false
#--MQTT authentication if necessary set MQTT_AUTH=true and enter user and password
MQTT_AUTH=false
MQTT_USER=
MQTT_PASSWORD=
#-System
#--cycle interval in seconds (max 300 seconds)
INTERVAL=10
#--log level, set "1" to get detailled logging
LOG_LEVEL=1
#--log files
LOGFILE=/tmp/rscp2mqtt.log
TOPIC_LOG_FILE=/tmp/rscp2mqtt.history
#--dry run
DISABLE_MQTT_PUBLISH=false
#--set power mode
AUTO_REFRESH=false
#--Start of Operation
HISTORY_START_YEAR=2017
#--Request daily historical values
DAILY_VALUES=true
#--Publish statistic values
STATISTIC_VALUES=true
#-MQTT Topics
#--Topic prefix (max 24 characters), default is e3dc
PREFIX=e3dc
#-Power Meter
#--PM_INDEX can be set multiple times if several power meters exist, default is 0
#--PM_EXTERN=true has the same effect as PM_INDEX=6 (6 for S10 Mini, compatibilty with previous releases)
PM_EXTERN=false
PM_INDEX=0
PM_REQUESTS=true
#-Photovoltaic Inverter
PVI_REQUESTS=true
#--Number of PVI strings/trackers (disables the auto detection)
PVI_TRACKER=2
#-Battery Settings
#--Number of Battery Strings, default is 1
BATTERY_STRINGS=1
#--Battery Modules
DCB_REQUESTS=true
#-Battery SOC limiter
#SOC_LIMITER=true
#LIMIT_CHARGE_SOC=0
#LIMIT_DISCHARGE_SOC=0
#LIMIT_CHARGE_DURABLE=false
#LIMIT_DISCHARGE_DURABLE=false
#LIMIT_DISCHARGE_BY_HOME_POWER=0
#-Wallbox Support for the wallbox with the specified index
#--only one WB_INDEX entry is supported, default is 0
WALLBOX=true
WB_INDEX=0
#-Forced Topics
#--will be published with every cycle
FORCE_PUB=e3dc/[a-z]+/power
#FORCE_PUB=e3dc/pvi/.*/string_[1,2]
FORCE_PUB=e3dc/solar/energy
FORCE_PUB=e3dc/battery/soc
FORCE_PUB=e3dc/battery/energy/discharge
FORCE_PUB=e3dc/battery/energy/charge
FORCE_PUB=e3dc/home/energy
FORCE_PUB=e3dc/grid/energy/in
FORCE_PUB=e3dc/grid/energy/out
#-Topic Logging
#--logging to extra log file configured by TOPIC_LOG_FILE
#TOPIC_LOG=e3dc/history/.*
#TOPIC_LOG=e3dc/battery/dcb/[1-4]/soh
#TOPIC_LOG=e3dc/system/software
Hallo Thomas,
wenn man bei der E3DC-Anlage die Reserve auf 100 % setzen möchte ("e3dc/set/reserve/percent 100"), dann reagiert die Anlage nicht. Bei Werten von 0 bis 99 funktioniert es. Ist das ein Bug bei rscp2mqtt oder liegt es an E3DC?
Gruß,
Oli
Support of REQ_SET_POWER commands to control the charging/discharging of the battery storage directly.
Presumably REQ_SET_POWER_MODE and REQ_SET_POWER_VALUE should be sent in one container.
I am available for testing if needed
Hi, a great software which I use since some time. :-)
Is it possible to add historical data of the wallbox like: e3dc/yesterday/wallbox/energy
On this occasion, the total energy consumed by the wallbox would also help a lot.
Maybe it's not just me who would really appreciate it. Many thanks
Please try
git clone --branch influxdb https://github.com/pvtom/rscp2mqtt.git
Hallo Thomas,
deine Applikation ist echt super und dein Support perfekt.
Einen Wunsch hätte ich noch, kannst du das gleiche wie bei den Solarstrings auch für die Wallbox machen, energy_total_day und energy_solar_day?
Da gibt es ja schon Topics, die einen enthalten aber nur die letzte Ladung und die anderen die Gesamtladung.
Gruß Sven
Wow, reading rscplib.js I am overwhelmed with possible Tags😮...
Let's use the dev branch to test some Tags and see what the returned values are and how usefull they might be for users.
WB_STATUS E800004
WB_ERROR_CODE E800005
WB_MODE E800006
WB_APP_SOFTWARE E800007
WB_BOOTLOADER_SOFTWARE E800008
WB_HW_VERSION E800009
WB_FLASH_VERSION E80000A
WB_DEVICE_ID E80000B
WB_PM_MODE E800011
WB_PM_DEVICE_ID E800015
WB_PM_ERROR_CODE E800016
WB_PM_FIRMWARE_VERSION E800017
WB_PM_DEVICE_STATE E800029
WB_FIRMWARE_VERSION E80002F
WB_DEVICE_NAME E800042
WB_AVAILABLE_SOLAR_POWER E841000
WB_SUN_MODE_ACTIVE E841038
WB_MAC_ADDRESS E841022
WB_GATEWAY E841031
WB_SUBNET_MASK E841032
WB_IP_ADDR E841033
WB_DHCP_ENABLED E841034
WB_WALLBOX_TYPE E841036
Would be cool, if you could implement them for testing.
Or let me know, how I need to modify the code to implement them in my local copy for testing the Tags.
rscp2mqtt core dumps on a Linux PC. Maybe a problem in the AES implementation. Same effect with the original example program.
Thank you for including the wallboxdata.
but I am missing two Datapoints.
To access them, we need to set "TAG_EMS_BATTERY_BEVORE_CAR_MODE" and "TAG_EMS_BATTERY_TO_CAR_MODE". Here we can enter the discharge level of the battery in sunmode. Maybe you have an clu how we get the data?
The 2nd Datapoint is to dis/allow to discharge the battery in mixed mode.
Best regards
Hello,
For the configured Startyear the History-Data is not requested.
x.year > cfg.history_start_year schould be x.year >= cfg.history_start_year
Hallo Thomas,
besteht die Möglichkeit, die Menge der Phasen (1 oder 3) zu setzen?
Ich nutze eine E3/DC Multi Connect Wallbox und schalte bisher manuell auf 1 Phase für die Überschussladung und auf 3 Phasen im Mischmodus.
Danke vorab und schöne Grüße
Dirk
Hallo Thomas,
da ich die rscp2mqtt Daten in eine Influxdb schreibe, bräuchte ich die Möglichkeit folgende TOPICS bei jedem Durchlauf zu schreiben, momentan funktioniert das nicht bei allen z.b. e3dc/wallbox/power/total. Dadurch entstehen Lücken und unschöne Graphen Verläufe (siehe Bild)
FORCE_TOPIC=e3dc/[a-z]+/power
FORCE_TOPIC=e3dc/[a-z]+/energy
FORCE_TOPIC=e3dc/grid/energy/[a-z]+
FORCE_TOPIC=e3dc/wallbox/[a-z]+/total
FORCE_TOPIC=e3dc/wallbox/[a-z]+/solar
FORCE_TOPIC=e3dc/pvi/[a-z]+/string_[1-2]
FORCE_TOPIC=e3dc/battery/energy/[a-z]+
FORCE_TOPIC=e3dc/battery/soc
FORCE_TOPIC=e3dc/battery/soh
FORCE_TOPIC=e3dc/battery/dcb/[1-4]/soh
FORCE_TOPIC=e3dc/battery/dcb/[1-4]/soc
FORCE_TOPIC=e3dc/battery/temperature/.*
Die TOPICS für Grafana sehen genauso aus.
Mache ich da etwas verkehrt?
Gruß Sven
First of all - I love this piece of software :-)
No issues, just some perceptions beyond the scope of the well-functional programming.
Would be interesting to receive feedback about them.
It´s about the meaning behind the parameters (semantics)
The E3DC RSCP doc+examples (found the last tag update from 2016) give a little insights about semantics, but it seems to me that E3DC doesn´t want them to be self-explanatory.
Maybe there is already some deeper pieces of information available somewhere to avoid reinventing the wheel?
If someone is interested in my contribution, let me know (along my personal learning curve with)
It seems that "e3dc/set/interval" is not considered, while the INTERVAL value of config file is taken into account on startup.
When starting rscp2mqtt, INTERVAL
setting in .config file sets the initial cadence of writing data to MQTT broker. When INTERVAL
is changed and rscp2mqtt got a restart, new frequency is applied.
README.md reports that the cadence can be changed by e.g. mosquitto_pub -h localhost -p 1883 -t "e3dc/set/interval" -m 2
, to change the interval. MQTT Explorer reflects the change in correct topic, but rscp2mqtt's update frequency doesn't change.
Commenting INTERVAL in config file results in default 1s cadence, but also here, newly published interval doesn't change this.
Btw.-1 "set/*" topics are not created by rscp2mqtt on startup, which might or might not be expected, e.g. to avoid feedback loops.:check:
Btw.-2 mosquitto_pub -h localhost -p 1883 -t "e3dc/set/force" -m 1
does result in a full topics refresh (except e3dc/set/*) 👍
Hi together
I am just preparing the config file and wondering what i have to do with the AES Password. Do i have to encrypt my password?
Regards
Patrick
Recent version of rscp2mqtt offers great support for multiple power meters, with subsequent values for power, voltage, energy and active phases. Those provide individual values for phases L1, L2, L3.
Yet, at least power and energy readings make sense to be provided as a sum of L1+L2+L3, e.g. as value for title topic:
e3dc/pm/1/power
= 1092 (W) or e3dc/pm/2/energy
= 535.836 (kWh).
This releases subscribed applications from such highly repetetive calculations.
Maybe similar summaries also for topics in other paths, aside of power meters?
Btw. topics e3dc/pm_0/energy
and e3dc/pm_1/energy
are constantly 0.00. Same for those under historical topics.
I love your tool and would like to know if there are any plans to query wallbox data?
Hi Thomas
Ich habe die Punkte von dir gestern umgestetzt. Ich habe einen Docker Container auf meiner Synology am laufen und erhalte nach dem Start die folgnede Ausgabe im Terminal
Beim Start habe ich folgendes im Log:
Ich bekomme dann aber Connection Error:
Mich erstaunt die Meldung cannot be converted.1.230. Dies sieht irgendwie wie Teile der IP
Im Config habe ich folgendes:
E3DC_IP=192.168.001.230
E3DC_PORT=5033
E3DC_USER=xxx
E3DC_PASSWORD=xxx
E3DC_AES_PASSWORD=xxx
MQTT_HOST=192.168.1.10
MQTT_PORT=1883
MQTT_AUTH=false
MQTT_USER=
MQTT_PASSWORD=
MQTT_QOS=0
MQTT_RETAIN=false
ENABLE_INFLUXDB=true
DISABLE_MQTT_PUBLISH=false
INFLUXDB_HOST=localhost
INFLUXDB_PORT=8086
INFLUXDB_VERSION=2
INFLUXDB_MEASUREMENT=e3dc
INFLUXDB_1_DB=e3dc
INFLUXDB_1_AUTH=false
INFLUXDB_1_USER=
INFLUXDB_1_PASSWORD=
INFLUXDB_2_ORGA=tognellacom
INFLUXDB_2_BUCKET=smartHome
INFLUXDB_2_TOKEN=xxx==
PREFIX=e3dc
LOGFILE=/tmp/rscp2mqtt.log
INTERVAL=1
PVI_REQUESTS=true
PVI_TRACKER=2
PM_REQUESTS=true
PM_EXTERN=false
DCB_REQUESTS=true
AUTO_REFRESH=false
WALLBOX=true
FORCE_PUB=e3dc/[a-z]+/power
FORCE_PUB=e3dc/battery/rsoc
FORCE_PUB=e3dc/pvi/.*/string_[1,2]
Ich sehe den Fehler nicht. Ich habe eine S10X mit Zusatzwechselrichter
Reading and interpreting powermeter values, I came across the wish to have kWh with float precision like 7.54 kWh. So far, TAG_PM_ENERGY_Lx deliver int kWh. I found my experience isn't good enough to change them to float, so I changed in RscpMqttMapping.h
:
from { TAG_PM_DATA, TAG_PM_ENERGY_L1, 0, "%s/energy/L1", "", F_FLOAT_D, UNIT_WH, 1000, 0, false, false, false },
to { TAG_PM_DATA, TAG_PM_ENERGY_L1, 0, "%s/energy/L1", "", F_FLOAT_2, UNIT_WH, 1, 0, false, false, false },
...
(changing F_FLOAT_D
to F_FLOAT_2
didn't help, it's still integer + the original is UNIT_KWH
, but change also didn't help)
Depending on your preference, is there a chance to change this to float from your end, or help by pointing to the correct changes for me to apply?
Hello,
Thank you for the bridge and the good documentation.
I have a problem switching the power limits in W works.
However, if I want to switch the power limits or the weather regulation, it doesn't work.
What can be the reason?
e3dc/set/max_charge_power
-> works
e3dc/set/weather_regulation
-> it does not work
e3dc/set/power_limits
-> it does not work
I have an S 10 X and switch out of IP Sycmon.
I haven't tested more yet.
Thanks and Regards
P.S. Sorry for my bad English, German would be better.
hello,
i would try to compile your latest version under Raspbian Buster and on a x86/x64 system Ubuntu focal (20.04) and jammy (22.04), but run into this error.
rm: cannot remove 'rscp2mqtt': No such file or directory
make: [Makefile:11: clean] Error 1 (ignored)
g++ -O3 RscpMqttMain.cpp RscpProtocol.cpp AES.cpp SocketConnection.cpp -lmosquitto -o rscp2mqtt
RscpMqttMain.cpp: In function ‘int createRequest(SRscpFrameBuffer*)’:
RscpMqttMain.cpp:308:104: error: ‘config_t’ {aka ‘struct _config_t’} has no member named ‘logfile’
(it->topic, "e3dc/set/log")) logCache(RSCP_MQTT::RscpMqttCache, cfg.logfile, buffer);
^~~~~~~
RscpMqttMain.cpp: In function ‘int main(int, char**)’:
RscpMqttMain.cpp:689:16: error: ‘config_t’ {aka ‘struct _config_t’} has no member named ‘logfile’
strcpy(cfg.logfile, "");
^~~~~~~
RscpMqttMain.cpp:720:28: error: ‘config_t’ {aka ‘struct _config_t’} has no member named ‘logfile’
strcpy(cfg.logfile, value);
^~~~~~~
make: *** [Makefile:7: rscp2mqtt] Error 1
Any ideas?
best regards
A question regarding value "e3dc/mode".
It jumps every few seconds between "1" and "2" within my installation S10X from Oct 2023.
In docker I see this log entry:
Error: Tag 0x06800400 received error code 4294967295.
In rsc2mqtt log file I see:
[2023-12-17 10:56:38] pid=1 ppid=0 RscpMqttMain.cpp(324) topic >e3dc/system/software< payload >H20_2023_024< unit ><
I tried to grab the values via mqtt explorer
my .config
// IP address of the E3/DC S10 device
E3DC_IP=192.168.X.Y
// Port of the E3/DC S10 device, default is 5033
E3DC_PORT=5033
// E3/DC account
[email protected]
E3DC_PASSWORD=password
// AES password
E3DC_AES_PASSWORD=password
// Target MQTT broker
MQTT_HOST=192.168.X.Y
// Default port is 1883
MQTT_PORT=1883
// MQTT user / password authentication necessary? Depends on the MQTT broker configuration.
MQTT_AUTH=false
// if true, then enter here
MQTT_USER=
MQTT_PASSWORD=
// MQTT parameters
MQTT_QOS=0
MQTT_RETAIN=false
// Topic prefix (max 24 characters), default is e3dc
PREFIX=e3dc
// log file
LOGFILE=rscp2mqtt.log
// history start year (installation of the E3/DC device)
HISTORY_START_YEAR=2023
// 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=3
// enable PVI requests, default is true
PVI_REQUESTS=true
// number of available PV strings(trackers), default is 2
PVI_TRACKER=2
// enable PM requests, default is true
PM_REQUESTS=true
// use external PM (S10 Mini), default is false
PM_EXTERN=false
// enable DCB (details for battery modules) requests, default is true
DCB_REQUESTS=false
// enable battery SOC limiter, default is false
SOC_LIMITER=true
// Auto refresh, default is false
AUTO_REFRESH=true
// Disable MQTT publish support (dryrun mode)
DISABLE_MQTT_PUBLISH=false
// Wallbox, default is false
WALLBOX=false
// topics to be published in each cycle (regular expressions)
FORCE_PUB=e3dc/.*
In OpenHAB forum I found a hint about too many persites item states leading to performance issues. In fact, I persisted with every change, now every 5 seconds. Surprise: the status of e3dc/mode change way less now. From every few seconds to twice in 30min:
2023-12-17 12:06:45.129 [INFO ] [b.automation.script.ui.E3DC_Notstrom] - E3DC Notstrombetrieb bereit. Status="1"
2023-12-17 12:06:46.675 [INFO ] [b.automation.script.ui.E3DC_Notstrom] - E3DC Notstrombetrieb nicht aktiv. Status="2"
Any idea, how to deeper understand this behaviour? The E3DC shows stable status
I am also using rscpgui (https://github.com/rxhan/RSCPGui) to get familiar with RSCP communication to my E3DC S10E System. As you might know, this project has some more (maybe officially undocumented) tags implemented.
Escpecially I would be interested to to get some basic information about the installed battery capacity, etc.
BAT_SPECIFIED_CAPACITY = 0x03800125
BAT_SPECIFIED_DSCHARGE_POWER = 0x03800126
BAT_SPECIFIED_CHARGE_POWER = 0x03800127
BAT_SPECIFIED_MAX_DCB_COUNT = 0x03800128
BAT_ROLE = 0x03800129
I already tried, but I failed, to implement other RSCP tags into your code.
My attempt was to define a new tag into RscpTags.h and then add a mapping into RscpMqttMapping.h, but I failed.
Can you help me?
Daily, weekly, yearly historica data - how to manage this?
Can I give a specific date or a range?
Hallo Thomas,
wie kann man (im Code) das Abfrageinterval für best. Tags ändern? Ich nutze aktuell das EMS WB_DISCHARGE_BAT_UNTIL und setze dies per MQTT, um es synchron mit Werten aus der Autoladesoftware evcc zu halten.
Dabei ist mir aufgefallen, dass sich der MQTT Wert e3dc/wallbox/battery_discharge_until
nach einem MQTT Set nicht ändert, da er wohl nur ab und zu (1x nach Start von rscp2mqtt ?) aktualisiert wird.
Wenn der häufiger aktualisert werden würde, könnte ich auch eine Automatik aufsetzen, die bei Änderung dieses Wertes im E3DC System meine evcc Steuerung synchronisiert.
I had problems to add rscp2mqtt to my FHEM installation via the build-in MQTT2 server. Finally I could do so after changing your mosquito connection string, which generates at every start a new random ClientID, to this fixed string (line 1621 in RscpMqttMain.cpp):
mosq = mosquitto_new("rscp2mqtt", true, NULL);
It would be fine, if it is possible to set a fixed ClientID in the config file.
Hi Thomas,
vielen Dank für Dein Modul (die Anleitung von e3DC ist ja ziemlich wild...)
Allerdings passt was mit meiner Connection noch nicht. Das Ganze läuft unter Docker compose.
Any hints? Vermute mal irgendwas in Richtung authorization oder reset connection?
VG timmo
Ich bekomme im Portainer log folgende Meldungen:
Log:
/rscp2mqtt [v3.8]
Connecting...
E3DC system >192.168.178.58:5033< user: >my.name<
MQTT broker >localhost:1883< qos = 0 retain = false
MQTT prefix: >e3dcrscp <
History year 2017 to 2023
Fetching data every 10 seconds.
Requesting PVI data = true (2 strings/trackers)
Requesting PM data = true
Requesting DCB (battery module) data = true
Battery SOC limiter active = false
Wallbox support = true
Auto refresh mode = false
Stdout to terminal
[2023-12-10 13:22:44] pid=1 ppid=0 RscpMqttMain.cpp(1970) Connecting to server 192.168.178.58:5033
[2023-12-10 13:22:44] pid=1 ppid=0 RscpMqttMain.cpp(1977) Success: E3DC connected.
[2023-12-10 13:22:44] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702210964)
[2023-12-10 13:22:46] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:22:46] pid=1 ppid=0 RscpMqttMain.cpp(1622) Connecting to broker localhost:1883
[2023-12-10 13:22:46] pid=1 ppid=0 RscpMqttMain.cpp(1633) Error: Connection failed.
[2023-12-10 13:22:56] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702210976)
[2023-12-10 13:22:59] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:22:59] pid=1 ppid=0 RscpMqttMain.cpp(1622) Connecting to broker localhost:1883
[2023-12-10 13:22:59] pid=1 ppid=0 RscpMqttMain.cpp(1631) Success: MQTT broker connected.
MQTT publish topic >e3dcrscp /battery/state< payload >EMPTY< unit ><
[2023-12-10 13:22:59] pid=1 ppid=0 RscpMqttMain.cpp(266) MQTT: starting listener loop
MQTT publish topic >e3dcrscp /grid/state< payload >IN< unit ><
[2023-12-10 13:23:09] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702210989)
[2023-12-10 13:23:12] pid=1 ppid=0 RscpMqttMain.cpp(1511) Error: Response receive timeout (retry)
[2023-12-10 13:23:22] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702211002)
[2023-12-10 13:23:22] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:23:32] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702211012)
[2023-12-10 13:23:32] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:23:42] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702211022)
[2023-12-10 13:23:42] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:23:52] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702211032)
[2023-12-10 13:23:52] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:24:02] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702211042)
[2023-12-10 13:24:02] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:24:12] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702211052)
[2023-12-10 13:24:12] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
[2023-12-10 13:24:22] pid=1 ppid=0 RscpMqttMain.cpp(725) Request authentication (1702211062)
[2023-12-10 13:24:22] pid=1 ppid=0 RscpMqttMain.cpp(1143) RSCP authentitication level 0
(etc.)
.config File:
// IP address of the E3/DC S10 device
E3DC_IP=192.168.178.58
// Port of the E3/DC S10 device, default is 5033
E3DC_PORT=5033
// E3/DC account
E3DC_USER=my.name
E3DC_PASSWORD=my.PW
// AES password
E3DC_AES_PASSWORD=my.AESPW
// Target MQTT broker
MQTT_HOST=localhost
// Default port is 1883
MQTT_PORT=1883
// MQTT user / password authentication necessary? Depends on the MQTT broker configuration.
MQTT_AUTH=false
// if true, then enter here
MQTT_USER=
MQTT_PASSWORD=
// MQTT parameters
MQTT_QOS=0
MQTT_RETAIN=false
// Topic prefix (max 24 characters), default is e3dc
PREFIX=e3dcrscp
// log file
LOGFILE=/tmp/rscp2mqtt.log
// history start year (installation of the E3/DC device)
HISTORY_START_YEAR=2017
// 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=10
// enable PVI requests, default is true
PVI_REQUESTS=true
// number of available PV strings(trackers), default is 2
PVI_TRACKER=2
// enable PM requests, default is true
PM_REQUESTS=true
// use external PM (S10 Mini), default is false
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=false
// Auto refresh, default is false
AUTO_REFRESH=false
// Disable MQTT publish support (dryrun mode)
DISABLE_MQTT_PUBLISH=false
// Wallbox, default is false
WALLBOX=true
// topics to be published in each cycle (regular expressions)
FORCE_PUB=e3dc/[a-z]+/power
FORCE_PUB=e3dc/battery/soc
Docker Compose
rscp2mqtt:
container_name: "rscp2mqtt"
image: pvtom/rscp2mqtt:latest-with-influxdb
restart: unless-stopped
environment:
- TZ=Europe/Berlin
volumes:
- ./volumes/rscp2mqtt/.config:/opt/rscp2mqtt/.config
network_mode: "host"
stdin_open: true
tty: true
rscp2mqtt didn't publish all changed values. This depends on the line "for (unsigned int i; i < frame.data.size(); i++)" in RscpMqttMain.cpp. The variable "i" wasn't initialized by the code, so the starting value is undefined.
Hallo Thomas,
mir ist aufgefallen dass bei den DCB Werten nicht alle Batterien kommen.
Ich habe 5 Stück und bekomme nur die ersten 3 Stück, welche am Batterie String 1 meines E3DC PRO hängt.
Die beiden Module auf dem zweiten Batterie-String werden nicht übertragen.
Gibts dafür auch TAGS mit denen du die Werte lesen kannst?
Danke & Grüße
Philipp
Hi,
short question, is it possible to select the e3dc/pvi/energy/string_x (today) instead off e3dc/pvi/energy_all/string_x (all time)?
This would be great!
Thx
Apart from root consumption power meter (PM#0, ROOT), I run a second PM to explicitly measure heat pump consumption (PM#1, ADDITIONAL_CONSUMPTION).
Topic "pm" reports full PM#0 values, but PM#1 values are not exposed. Changing RscpMqttMain.cpp from
protocol.appendValue(&PMContainer, TAG_PM_INDEX, (uint8_t)0);
to
protocol.appendValue(&PMContainer, TAG_PM_INDEX, (uint8_t)1);
shows PM#1 in pm/* topics.
Maybe a list of indexes in config file would allow cycling through all available powermeters, or those that are wanted to be queried?
Assuming pm_0 and pm_1 relate to the two powermeters in my system, "pm_0/energy" and "pm_1/energy" topics are available, but no more. Both those energy values are 0.00 at all times.
Hello,
the influxdb v1 Implementation is missing the the Auth possibility for authentifikation:
if (cfg.influxdb_version == 1) {
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.influxdb_user);
curl_easy_setopt(curl, CURLOPT_PASSWORD, cfg.influxdb_password);
sprintf(buffer, "http://%s:%d/write?db=%s", cfg.influxdb_host, cfg.influxdb_port, cfg.influxdb_db);
I will try to imlement
Hi Tom
noch eine Frage - bei der Configuration von Influxdb2 schreibt das Modul einfach alle Daten in die DB (Klappt prima).
Gibt es eine Möglichkeit, hier nur ausgewählte Topics (entlang von FORCEPUB - aber halt als PUB2INFLUX) zu schreiben - oder empfiehlst Du, dann über den MQTT Broker zu gehen, und Telegraf die Auswahl zu überlssen?
Viele Grüße - Timmo
Hi,
{ 0, TAG_EMS_REQ_SET_BATTERY_BEFORE_CAR_MODE, "e3dc/set/wallbox/battery_before_car", "^true|on|1$", "1", "^false|off|0$", "0", "", RSCP::eTypeUChar8, -1, true },
ich habe noch Probleme mit dieser Zeile. Wenn ich am Speicher die Einstellung ändere bekomme ich
0 = zuerst Wallbox
1 = zuerst Hausbatterie
Das gleiche Ergebnis, erhalte ich, wenn ich über das E3DC Portal schalte.
Sende ich über MQTT eine 0 wird auf "zuerst Wallbox" geschaltet.
Sende ich über MQTT eine 1 wird auch auf "zuerst Hausbatterie" geschaltet. ABER. Leider nicht immer. Ich kann manchmal mehrmals hintereinander umschalten, manchmal bleibt aber der Wert immer bei "zuerst Wallbox". In diesem Zustand komme ich nur raus, wenn ich am Speicher oder per Portal auf "zuerst Hausbatterie" schalte.
Danach klappen die Umschaltvorgänge meistens wieder für kurze zeit. Hast Du da eine idee?
The topic shows the number of minutes in which the system runs into the feed-in limitation. This should be expressed more clearly in the name.
Hi Tom,
noch zwei Fragen zu den historischen Werten:
Die e3DC liefert ja werte für "yesterday", "week", "month", "year". Weiterhin gibt es das Topic "history" nach Jahren geordnet.
VG TImmo
(hoffe, dass das der richtige Kanal für solche Fragen ist - oder hast Du ein separates Forum?)
Great software and exactly, what I needed. Many thanks.
The ID of the external PM of my E3DC S10 is 4 and not 6. Therefore I had to change RscpMqttMain.cpp the line
protocol.appendValue(&PMContainer, TAG_PM_INDEX, (uint8_t)6);
to
protocol.appendValue(&PMContainer, TAG_PM_INDEX, (uint8_t)4);
It would be probably a good idea, to add a parameter e.g. PM_INDEX to the config file.
Hi Thomas
ich habe seit einiger Zeit diese Meldungen im Log, und das Schreiben auf die influx DB klappt nicht. Scheint, dass die Verbindung zum e3DC nicht klappt. Nach einem Neustart des Docker Containers geht's wieder einige Zeit.
Any hints?
VG timmo
Version:
org.opencontainers.image.version | v3.17-with-influxdb
[2024-03-23 13:57:08] pid=1 ppid=0 RscpMqttMain.cpp(2515) Connecting to server 192.168.178.58:5033
[2024-03-23 13:57:08] pid=1 ppid=0 RscpMqttMain.cpp(2522) Success: E3DC connected.
[2024-03-23 13:57:08] pid=1 ppid=0 RscpMqttMain.cpp(1930) Error: Maximum buffer size exceeded 69632
Nach dem Restart des Docker Containers kommen folgende Logs, In influx kommen wieder Daten an:
rscp2mqtt [v3.17.influxdb]
E3DC system >192.168.178.58:5033< user: >(private)<
MQTT broker >localhost:1883< qos = >0< retain = >false< client id >✗< prefix >e3dc<
INFLUXDB v2 >localhost:8086< orga = >home< bucket = >e3dc_new< measurement = >e3dc<
Fetching data every 15 seconds.
Requesting PVI ✓ | PM (0) | DCB ✓ (1 battery string) | Wallbox (0) ✓ | Autorefresh ✗
Log level = 0
Stdout to pipe/file
[2024-03-23 14:00:39] pid=1 ppid=0 RscpMqttMain.cpp(2515) Connecting to server 192.168.178.58:5033
[2024-03-23 14:00:39] pid=1 ppid=0 RscpMqttMain.cpp(2522) Success: E3DC connected.
[2024-03-23 14:00:39] pid=1 ppid=0 RscpMqttMain.cpp(1533) RSCP authentication level 10
[2024-03-23 14:00:39] pid=1 ppid=0 RscpMqttMain.cpp(2063) Connecting to broker localhost:1883
[2024-03-23 14:00:39] pid=1 ppid=0 RscpMqttMain.cpp(313) MQTT: starting listener loop
[2024-03-23 14:00:39] pid=1 ppid=0 RscpMqttMain.cpp(2075) Success: MQTT broker connected.
[2024-03-23 14:00:44] pid=1 ppid=0 RscpMqttMain.cpp(1943) Error: Response receive timeout (retry)
[2024-03-23 14:00:48] pid=1 ppid=0 RscpMqttMain.cpp(1943) Error: Response receive timeout (retry)
Hi @pvtom,
vielen Dank für das coole Projekt. Ich würde rscp2mqtt gerne als Container bereitstellen um es als Add-On in Home Assistant OS bereitzustellen. Voraussetzung für das Deployment in Containern ist, dass das Logging nicht in ein Logfile geschieht, sondern nach stdout
und stderr
. Warum das so ist wird erklärt in https://12factor.net/logs / https://12factor.net/de/logs
Wäre es ein großer Aufwand, nach stdout
und stderr
zu loggen, wenn zum Beispiel LOGFILE=
leer gelassen wird?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.