Giter Site home page Giter Site logo

fabian-lauer / dbus-solax-x1-pvinverter Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 3.0 394 KB

Get production values from Solax Cloud for X1 inverter and feed them into Victron Venus OS DBus to make same available on CCGX and VRM portal

Python 90.72% Shell 9.28%
dbus dbus-python victron victronenergy venusos solax-inverter solax-power solaxpower

dbus-solax-x1-pvinverter's Introduction

dbus-solax-x1-pvinverter

Get production values from Solax Cloud for X1 inverter and feed them into Victron Energies Venus OS DBus to make same available on CCGX and VRM portal

Purpose

I wanted to get a least some values from my PV inverter into the VRM portal. Even if the limitation of this setup is, that values on Solax Cloud are only updated every 5 minutes. Solax X1 inverter offer ModBus support, but I am not that deep into it, so lets go for the cloud/RESTapi way ;-)

Inspiration

This project is one of my first projects on GitHub and with Victron components as well as in Python. So for this one here I cook basicaly the code from my Shelly 3EM Smartmeter into DBus integration.

How it works

My setup

  • Shelly 3EM with latest firmware (20220209-094824/v1.11.8-g8c7bb8d)
    • 3-Phase installation (normal for Germany)
    • Connected to Wifi netowrk "A"
    • IP 192.168.2.108/24
  • Victron Energy Cerbo GX with Venus OS - Firmware v2.84
    • Connected to Wifi netowrk "A"
    • IP 192.168.2.110/24
  • Victron MultiPlus II 48/3000
  • Solax X1 Boost 5.0 DT
    • 5kW
    • Wifi Stick
    • Solax Cloud account with API credentials

Details / Process

As mentioned above the script is inspired by @RalfZim fronius smartmeter implementation. So what is the script doing:

  • Running as a service
  • connecting to DBus of the Venus OS com.victronenergy.pvinverter.pv_[SERIAL-OF-INVERTER]
  • After successful DBus connection Solax Cloud is accessed via REST-API and a JSON is returned with all details
  • Serial/MAC is taken from the response as device serial
  • Paths are added to the DBus with default value 0 - including some settings like name, etc
  • After that a "loop" is started which pulls data every xxx ms from the REST-API and updates the values in the DBus

Thats it ๐Ÿ˜„

Pictures

VRM overview Remote Console - Overview Inverter- Values Inverter - Device Details

Install & Configuration

Get the code

Just grap a copy of the main branche and copy them to /data/dbus-solax-x1-pvinverter. After that call the install.sh script.

The following script should do everything for you:

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
chmod a+x /data/dbus-solax-x1-pvinverter/install.sh
/data/dbus-solax-x1-pvinverter/install.sh
rm main.zip

โš ๏ธ Check configuration after that - because service is already installed an running and with wrong connection data (host, username, pwd) you will spam the log-file

Change config.ini

Within the project there is a file /data/dbus-solax-x1-pvinverter/config.ini - just change the values

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
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

Used documentation

Discussions on the web

This module/repository has been posted on the following threads:

dbus-solax-x1-pvinverter's People

Contributors

fabian-lauer avatar

Stargazers

 avatar  avatar

Watchers

 avatar

dbus-solax-x1-pvinverter's Issues

Energy Consumption while PV is Charging

Hi,

I have implemented your script. Thanks for that.
I have configuration 1 active, so my SolaX is connected to AC-Out1 on L3
I think everything seems to be fine exact one thing:
The PV generated Power is shown as consumption on Phase 3.

image

Values in AC loads are Wrong if inverter is not installed on Phase L1

Hi,

could you please add a config Value in the Settings if the Inverter is not on Phase L1?
My inverter is installed on L3, so the Values in the Display for AC-Loads are wrong.
Please also have a look in the Discussion, because i found a solution for realtime data from the inverter

Thanks
Dietmar

Over the limit of API access

Hi,

since newest VenusOS update (I guess) I'm getting from time to time the following critical error message while asking solar cloud for production:

2022-11-08 07:21:59,518 root CRITICAL Error at _update Traceback (most recent call last): File "/data/dbus-solax-x1-pvinverter/dbus-solax-x1-pvinverter.py", line 214, in _update meter_data = self._getSolaxCloudData() File "/data/dbus-solax-x1-pvinverter/dbus-solax-x1-pvinverter.py", line 151, in _getSolaxCloudData raise ValueError("Response (%s) is not ok - 'success'=%s 'exception'=%s" % ( URL, data['success'], data['exception'])) ValueError: Response (https://www.eu.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=xxxxx&sn=xxxx) is not ok - 'success'=False 'exception'=One minute access over limit!

Is there something wrong with my configuration? Is the query period / amount configurable?

Holger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.