HomeWizard Battery plugin

Python and python framework

Moderator: leecollings

rini52
Posts: 38
Joined: Friday 10 June 2022 23:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.1
Location: NL
Contact:

Re: HomeWizard Battery plugin

Post by rini52 »

thanks,

That is the type that is created by the HomeWizard Battery plugin and is called "Active Power" and possible to include in the Electricity Dashboard.
But no possibility to include more than one battery per hardware integration. So you have to do combine them in one single hardware setup,as you did apparently. But that needs a mayor update of the plugin with some extra token/ip settings. Therefor I just combine them with a dzventz script. I used a "usage electric" sensor but apparently I could have better use a "general kwh" dummy sensor.

Regards,
Domoticz running on Pi-4, Ubuntu(amd64), Synology Nas and VM
Hardware: RFXCOM, RFLINK, P1-smartmeter-HomeWizard, Z2M Sonoff dongle(20+ devices), Esp8266 (counters), Eaton_3S ups
mvdp
Posts: 20
Joined: Sunday 07 October 2018 17:21
Target OS: Linux
Domoticz version: 2025.1
Location: Bollenstreek
Contact:

Re: HomeWizard Battery plugin

Post by mvdp »

rini52 wrote: Friday 23 May 2025 11:47 This is really great stuff. I just received 3 batteries and they work great as they were designed. However the p1-senseor is not selectable from the energy dashboard the "active power" sensor is. This sensor shows the Import-Export power of the battery. Since I had 3 batteries i had to sum them and put the result in a "usage electricity" sensor. Similar for the percentage(SOC) sensors. They can both be used in the Energy Dashboard"
Thanks for the feedback. I will mention in README.md that one can combine multiple batteries using some additional event handling code. I don't feel like combining multiple batteries together with the plugin.

I myself have 2 batteries and I just configured them in domoticz as 2 separate hardware devices. And indeed I'm using a dummy device to sum the actual power together using some lua scripting. A similar script runs when the SOC of a battery changes to provide the overal SOC value.

Code: Select all

return
{
    on =
    {
        devices = {1827, 1828}
    },
	execute = function(domoticz, item)
        local battery1Power = domoticz.devices(1827)    -- Battery set 1, existing General kwh device
        local battery2Power = domoticz.devices(1828)    -- Battery set 2, existing General kwh device
        -- Create manually a dummy kWh, Electricity (instant and counter) device in generation mode
        local totalPower = domoticz.devices(1813)       -- Total, to be used in Energy dashboard configuration
        
        totalPower.updateElectricity(
        	battery1Power.actualWatt + battery2Power.actualWatt,
        	battery1Power.WhTotal + battery2Power.WhTotal)
	end
}
WilcoEHV
Posts: 18
Joined: Monday 02 January 2023 15:52
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.1
Location: Eindhoven
Contact:

Re: HomeWizard Battery plugin

Post by WilcoEHV »

Hi,
Great work.
I have a HW battery and i want to include it into Domoticz.
Although i'm an Domoticz enthusiast since 2017 i'n not femilliar with scripting.
Can someone guide me through setting up this plugin?

PS; I've considered following a course scripting before, any suggestions on where to start are welcome!
Raspberry 3B with Raspberry PI OS
mvdp
Posts: 20
Joined: Sunday 07 October 2018 17:21
Target OS: Linux
Domoticz version: 2025.1
Location: Bollenstreek
Contact:

Re: HomeWizard Battery plugin

Post by mvdp »

WilcoEHV wrote: Tuesday 27 May 2025 19:50 Can someone guide me through setting up this plugin?
Good news, with 1 battery there is no need for scripting.

To install the python plugin see this wiki page: https://wiki.domoticz.com/Using_Python_plugins
Consider using the domoticz python plugin manager, as that takes the burden away from the git checkout. To be honest, I have not used the plugin manager plugin. See https://wiki.domoticz.com/Python_Plugin_Manager

Read the readme.md of the battery plugin to get a token needed to communicate with it.

Let me know in case of questions.
rini52
Posts: 38
Joined: Friday 10 June 2022 23:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.1
Location: NL
Contact:

Re: HomeWizard Battery plugin

Post by rini52 »

Thanks for the example.
Attached I included tthe percentage as well.

Regards
HWZ_PlgBat_summary.txt
(1.96 KiB) Downloaded 36 times
Domoticz running on Pi-4, Ubuntu(amd64), Synology Nas and VM
Hardware: RFXCOM, RFLINK, P1-smartmeter-HomeWizard, Z2M Sonoff dongle(20+ devices), Esp8266 (counters), Eaton_3S ups
zanco
Posts: 16
Joined: Monday 04 January 2016 20:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: HomeWizard Battery plugin

Post by zanco »

Thanks for your work. It works nicely, added 2 homewizzard batteries to my domoticz.

Yesterday I reworked my internal network after being forced to a double router system by my fiber company delivering a modem / router with no bridge mode possible. So yesterday I moved the Asus router to AP mode and had all my IP addresses moved to another range. The hardware setup to change the battery and P1 IP addresses are easy.

It took me however a few hours and a good night sleep AND your readme.md to get the clue why the batteries did not report since yesterday afternoon. The token generated is based on the original IP adress so I have generated 2 new tokens which I changed in the settings and all is OK now.


One little remark: excecuting the scripts for detect require me to type python3 scriptname.py instead of python (which is python2.7 on my system)

Just in case someone runs into the same problem.

Thanks again,
Ben
mvdp
Posts: 20
Joined: Sunday 07 October 2018 17:21
Target OS: Linux
Domoticz version: 2025.1
Location: Bollenstreek
Contact:

Re: HomeWizard Battery plugin

Post by mvdp »

👍
Thank you for the suggestion of using python3 instead of python. I’ve changed it in the readme and code.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest