Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modbus support #5

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.ini
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# dbus-solax-x1-pvinverter
Get production values from Solax Cloud for X1 inverter and feed them into [Victron Energies Venus OS](https://github.com/victronenergy/venus) DBus to make same available on CCGX and VRM portal
# dbus-solax-x-pvinverter
Get production values from Solax Modbus or Solax Cloud for X1/X3 inverters and feed them into [Victron Energies Venus OS](https://github.com/victronenergy/venus) DBus to make same available on CCGX and VRM portal


## Purpose
Expand All @@ -14,7 +14,7 @@ So for this one here I cook basicaly the code from my [Shelly 3EM Smartmeter int


## How it works
### My setup
### Possible setup
- Shelly 3EM with latest firmware (20220209-094824/v1.11.8-g8c7bb8d)
- 3-Phase installation (normal for Germany)
- Connected to Wifi netowrk "A"
Expand Down Expand Up @@ -57,6 +57,7 @@ After that call the install.sh script.

The following script should do everything for you:
```
pip install solax-x3-rs485
wget https://github.com/fabian-lauer/dbus-solax-x1-pvinverter/archive/refs/heads/main.zip
unzip main.zip "dbus-solax-x1-pvinverter-main/*" -d /data
mv /data/dbus-solax-x1-pvinverter-main /data/dbus-solax-x1-pvinverter
Expand All @@ -70,17 +71,25 @@ rm main.zip
### Change config.ini
Within the project there is a file `/data/dbus-solax-x1-pvinverter/config.ini` - just change the values

If you add MODBUS to your config the SOLAXCLOUD settings will be ignored.

To use with only one phase (X1 devices) just remove Phase2 and Phase3 from the INVERTER.PHASES section.

| Section | Config vlaue | Explanation |
| ------------- | ------------- | ------------- |
| DEFAULT | SignOfLifeLog | Time in minutes how often a status is added to the log-file `current.log` with log-level INFO |
| APP | SignOfLifeLog | Time in minutes how often a status is added to the log-file `current.log` with log-level INFO |
| MODBUS | port | The port of the modbus adapter to use ie. /dev/ttyUSB0 |
| MODBUS | unit | The modbus unit id, if multiple units share the same modbus, default = 1 |
| SOLAXCLOUD | Endpoint | API endpoint - should always be the same |
| SOLAXCLOUD | TokenId | TokenId from Solax Cloud portal |
| SOLAXCLOUD | RegNo | RegNo of inverter WifiStick |
| INVERTER | Position | Refer to Victron documentation - 0=AC input 1; 1=AC output; 2=AC input 2 |
| INVERTER | MaxPower | Inverter max AC power in watts |
| INVERTER | GridVoltage | The voltage is not returned by RESTapi so we use this value to calculate the current based on power |
| INVERTER | Phase | Phase your inverter is connected to |

| INVERTER.PHASES | Phase1 | Name of Phase 1, ie. L1 |
| INVERTER.PHASES | Phase2 | Name of Phase 2, ie. L2 |
| INVERTER.PHASES | Phase3 | Name of Phase 3, ie. L3 |

## Used documentation
- https://github.com/victronenergy/venus/wiki/dbus#grid DBus paths for Victron namespace
Expand Down
15 changes: 13 additions & 2 deletions config.ini → config.ini.template
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
[DEFAULT]
[APP]
SignOfLifeLog=5

[MODBUS]
#unit=1
port=/dev/ttyUSB1

[SOLAXCLOUD]
Endpoint=https://www.eu.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do
TokenId=12345678901234567890
RegNo=COOLREGNO

[INVERTER]
Name=Solax X1
Position=0
MaxPower=5000
GridVoltage=230
Phase=L1
Phase=L1
SN=INVERTERSERIAL

[INVERTER.PHASES]
Phase1=L1
Phase2=L2
Phase3=L3
Loading