question

back2basic avatar image
back2basic asked

Home Wizzard Energy P1 meter in VenusOS

Hello community,

Inspired by the dbus-shelly-3em-smartmeter from @fabian-lauer, I created dbus-Home-Wizzard-Energy-P1 for users that have a Home Wizzard Energy P1 meter (wifi). I'm currently waiting for my Multiplus to test it in a ESS system, the P1 data show correctly in VenusOS.

Link to repository: https://github.com/back2basic/dbus-Home-Wizzard-Energy-P1
Here are some screenshots from my setup:


screenshot-2023-10-21-at-114258.png
screenshot-2023-10-21-at-114316.png
screenshot-2023-10-21-at-114341.png
How to install: (once installed it auto starts on reboot)

wget https://github.com/back2basic/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

After install edit the file:

nano /data/dbus-Home-Wizzard-Energy-P1/config.ini

change the IP for Host
change Phases to 3 if you have a 3 phase system


How to remove:

/data/dbus-Home-Wizzard-Energy-P1/uninstall.sh
rm -rf /data/dbus-Home-Wizzard-Energy-P1
Venus OSEnergy Meterpower meter
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

marc-heide avatar image marc-heide commented ·

Thank you verry much! knipsel.jpg

0 Likes 0 ·
knipsel.jpg (16.5 KiB)
6 Answers
meyo084 avatar image
meyo084 answered ·

Hi! , thanks for sharing this, would realy like to start using this as well.. could you please write some instructions how to start using this?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

meyo084 avatar image
meyo084 answered ·

Thanks! Wil try this next week!

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

home3131 avatar image
home3131 answered ·

Hi! , thanks for sharing this. This is really a solution I was looking for. I'm a complete newbie on the BUS part and how to connect. I support the above question for a little more detailed install instructions. Venus OS and my Victron MPPT and Smart shunt are running perfectly. Would love to add the AC site through my Homewizard P1.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

home3131 avatar image home3131 commented ·

I don't know how to report a small error in the code.

When 3 Phase is entered Phases are shown but all display the same power value of L1.

This part in the dbus-Home-Wizzard-Energy-P1.py file is the problem

self._dbusservice['/Ac/L1/Power'] = meter_data['active_power_l1_w']

self._dbusservice['/Ac/L2/Power'] = meter_data['active_power_l1_w']

self._dbusservice['/Ac/L3/Power'] = meter_data['active_power_l1_w']

These 3 lines all point to .... _power_l1_w

I changed this to

self._dbusservice['/Ac/L1/Power'] = meter_data['active_power_l1_w']

self._dbusservice['/Ac/L2/Power'] = meter_data['active_power_l2_w'

self._dbusservice['/Ac/L3/Power'] = meter_data['active_power_l3_w']


Everything works perfectly. (Change and reboot)

0 Likes 0 ·
back2basic avatar image back2basic home3131 commented ·
thxx for the comment, I'll change to code on github for that.
1 Like 1 ·
ldream avatar image
ldream answered ·

Hello a question i am new to this i changed the host to my network do i have to fill in the username and password i use for my homewizard P1 Thanks

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

meyo084 avatar image meyo084 commented ·
Hi, no this is not needed.. seems a left over of the Shelly fork..
0 Likes 0 ·
meyo084 avatar image
meyo084 answered ·

Hi, iam using this driver wich for the energy grid metering works perfectly but somehow my energy consumtion history in VRM got periods of time when there is no consumption data.. does any one else has this same behaviour?

1704718070910.png


1704718070910.png (36.9 KiB)
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

meyo084 avatar image meyo084 commented ·

Already found the reason for this problem, @back2basic the of AC Forward and AC Reverse vallues of the are divided by 1000. This results in a wrong value. Do you know the reason for this? I removed the divider from the code wich solves my problem..


self._dbusservice['/Ac/Energy/Forward'] = (meter_data['total_power_import_kwh']/1000)

self._dbusservice['/Ac/Energy/Reverse'] = (meter_data['total_power_export_kwh']/1000)


Ive no reason is known, could you please change this and publish a new version on git?


Thanks!

0 Likes 0 ·
andre0001 avatar image
andre0001 answered ·

Hi,

Today I started using this code and it behaves slightly different then expected.
Loading and installing the code worked fine. After configuring the INI file (host IP) and rebooting VenusOS, HomeWizzard is visible in the menu. Unfortunately it does not show any power on the main page, in the red AC input tile.

As in the attached image; it does show total power in the menu...

Other info that might be relevant;
Single phase setup.
There is no MPII connected in my setup YET.
1x SMA inverter connected via Modbus, 2x Hoymiles connected via dbus-openDTU.
PV inverters are directly connected to grid. Configured in VenusOS as connected to ACout1 (otherwise they did not show up)


Have I done something wrong?
What do I need to do to visualize the HomeWizzard power sensor on the front page?

homewizzard-venusos.png


5 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

andre0001 avatar image andre0001 commented ·

Problem found. I'm not a programmer, so took some time to get to this point..

Logfile was flooded with following, indicating that there was no active_voltage_l1.

2024-03-22 18:40:17,533 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-Home-Wizzard-Energy-P1/dbus-home-wizzard-energy-p1.py", line 172, in _update
    self._dbusservice['/Ac/L1/Voltage'] = meter_data['active_voltage_l1_v']
KeyError: 'active_voltage_l1_v'

Following message is reported by Home Wizzard, indeed, without voltage_l1_v:

{"wifi_ssid":"xxxxxx","wifi_strength":90,"smr_version":42,"meter_model":"Landis + Gyr xxxxxx","unique_id":"xxxxxx","active_tariff":2,"total_power_import_kwh":xxxxx.xxx,"total_power_import_t1_kwh":xxxx.xxx,"total_power_import_t2_kwh":xxxx.xxx,"total_power_export_kwh":xxxx.xx,"total_power_export_t1_kwh":xxxx.xxx,"total_power_export_t2_kwh":xxxx.xxxx,"active_power_w":289,"active_power_l1_w":289,"active_current_l1_a":2,"voltage_sag_l1_count":0,"voltage_swell_l1_count":0,"any_power_fail_count":1,"long_power_fail_count":0,"total_gas_m3":5663.558,"gas_timestamp":240322190000,"gas_unique_id":"xxxxxxx","external":[{"unique_id":"xxxxxxx","type":"gas_meter","timestamp":240322190000,"value":xxxx.xxx,"unit":"m3"}]}

Commented out the active_voltage_l1 line in "dbus-home-wizzard-energy-p1.py" and restarted VenusOS (restart.sh does not work either)

# self._dbusservice['/Ac/L1/Voltage'] = meter_data['active_voltage_l1_v']

VenusOS portal now shows the power in the red AC input tile! Great!!

Unfortunately still other errors in the log to work on.

2024-03-22 19:04:16,430 root CRITICAL Error at _update
Traceback (most recent call last):
  File "/data/dbus-Home-Wizzard-Energy-P1/dbus-home-wizzard-energy-p1.py", line 183, in _update
    # self._dbusservice['/Ac/L1/Energy/Forward'] = (meter_data['total_power_import_kwh'])
  File "/opt/victronenergy/dbus-systemcalc-py/ext/velib_python/vedbus.py", line 157, in __setitem__
    self._dbusobjects[path].local_set_value(newvalue)
KeyError: '/Ac/L1/Energy/Forward'
0 Likes 0 ·
dutchsolarfreak avatar image dutchsolarfreak andre0001 commented ·

@Andre0001 Did you contacted HomeWizard regarding the missing active_voltage_l1_v value in the JSON? I know the dbus-driver is not made or supported by HomeWizard but from my point of view active_voltage_l1_v should always be in the JSON. So to me this seems to be a bug in the HomeWizard P1 meter firmware.

0 Likes 0 ·
andre0001 avatar image andre0001 dutchsolarfreak commented ·

Hi @DutchSolarFreak,

No, I did not contact HomeWizzard about it yet.
I spend some this morning time to figure out if it should be in the telegram/message always, but have not found data to proof this.
I have connected my P1 port with a serial-USB cable to domoticz for a few years, never seen the voltage to be reported there.

Grid meter is an Landis Gyr+ E350 (ZCF110CCtFs2) E0031
DSMR 4.2.

Maybe your meter is a more recent type with DSMR 5.x ? and therefore can report the voltage?

I checked "http://<HomeWizzardIP>/api/v1/telegram" but also could not find a value that looks like the voltage too.

0 Likes 0 ·
dutchsolarfreak avatar image dutchsolarfreak andre0001 commented ·

Voltage is reported in the JSON:

1711283805718.png

But I understood that sometimes active_voltage_l1_v is not present in the JSON.

I am facing some issues (at a different 3fase system) that sometimes no voltages are shown in VRM (for a few minutes) but power and current is there:

1711284162402.png

Top graph is Voltage (drops to 0) and bottom is power and is still available.

I thought that connection was bad but I doubt that. I think sometimes HomeWizard P1 is not sending voltages.

(FYI I am using my own dbus homewizard P1 driver)

0 Likes 0 ·
1711283805718.png (39.7 KiB)
andre0001 avatar image andre0001 dutchsolarfreak commented ·
Hello @DutchSolarFreak

Thanks for the feedback.
Based on your P1 telegram, it seems that your meter has (D)SMR V5.0. Maybe that explains the voltage being reported?

0 Likes 0 ·

Related Resources

Victron Venus OS Open Source intro page

Venus OS GitHub (please do not post to this)

Energy Meter Selection Guide

Additional resources still need to be added for this topic