#fork from https://github.com/vincegod/dbus-shelly-em-smartmeter for own setpoints
Integrate Home Wizzard Energy P1 meter into Victron Energies Venus OS
With the scripts in this repo it should be easy possible to install, uninstall, restart a service that connects the Shelly 3EM to the VenusOS and GX devices from Victron. Idea is pasend on @RalfZim project linked below.
This project is my first on GitHub and with the Victron Venus OS, so I took some ideas and approaches from the following projects - many thanks for sharing the knowledge:
- https://github.com/RalfZim/venus.dbus-fronius-smartmeter
- https://github.com/victronenergy/dbus-smappee
- https://github.com/Louisvdw/dbus-serialbattery
- https://community.victronenergy.com/idea/114716/power-meter-lib-for-modbus-rtu-based-meters-from-a.html - Old Thread
- https://github.com/fabian-lauer/dbus-shelly-3em-smartmeter
- Home Wizzard Energy P1 with latest firmware
- 1 or 3-Phase installation (normal for Netherlands)
- Connected to Wifi network "A"
- IP 192.168.2.13/24
- Victron Energy Cerbo GX with Venus OS - Firmware v3.11
- No other devices from Victron connected (still waiting for shipment of Multiplus-2)
- Connected to Wifi network "A"
- IP 192.168.2.20/24
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.grid.http_40
orcom.victronenergy.pvinverter.http_40
- After successful DBus connection Home Wizzard P1 is accessed via REST-API - simply the /status is called and a JSON is returned with all details A sample JSON file from Home Wizzard Energy P1 can be found here
- Serial 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 Home Wizzard P1 data every 750ms from the REST-API and updates the values in the DBus
Thats it 😄
Just grap a copy of the main branche and copy them to /data/dbus-Home-Wizzard-Energy-P1
.
After that call the install.sh script.
The following script should do everything for you:
wget https://github.com/tomashaglund1/dbus-Home-Wizzard-Energy-P1/archive/refs/heads/main.zip
unzip main.zip "dbus-Home-Wizzard-Energy-P1-main/*" -d /data
mv /data/dbus-Home-Wizzard-Energy-P1-main /data/dbus-Home-Wizzard-Energy-P1
chmod a+x /data/dbus-Home-Wizzard-Energy-P1/install.sh
/data/dbus-Home-Wizzard-Energy-P1/install.sh
rm main.zip
Within the project there is a file /data/dbus-Home-Wizzard-Energy-P1/config.ini
- just change the values - most important is the host, username and password in section "ONPREMISE". More details below:
Section | Config vlaue | Explanation |
---|---|---|
DEFAULT | AccessType | Fixed value 'OnPremise' |
DEFAULT | SignOfLifeLog | Time in minutes how often a status is added to the log-file current.log with log-level INFO |
DEFAULT | CustomName | Name of your device - usefull if you want to run multiple versions of the script |
DEFAULT | DeviceInstance | DeviceInstanceNumber e.g. 40 |
DEFAULT | Role | Fixed value: 'GRID' |
DEFAULT | Position | Fixed value: 0 = AC |
DEFAULT | LogLevel | Define the level of logging - lookup: https://docs.python.org/3/library/logging.html#levels |
DEFAULT | Phases | 1 for 1 phase system / 3 for 3 phase system |
ONPREMISE | Host | IP or hostname of on-premise Shelly 3EM web-interface |
- https://github.com/victronenergy/venus/wiki/dbus#grid DBus paths for Victron namespace GRID
- https://github.com/victronenergy/venus/wiki/dbus#pv-inverters DBus paths for Victron namespace PVINVERTER
- https://github.com/victronenergy/venus/wiki/dbus-api DBus API from Victron
- https://www.victronenergy.com/live/ccgx:root_access How to get root access on GX device/Venus OS
This module/repository has been posted on the following threads: