Page 2 of 2
Re: HomeWizard Battery plugin
Posted: Friday 23 May 2025 16:21
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,
Re: HomeWizard Battery plugin
Posted: Tuesday 27 May 2025 15:07
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
}
Re: HomeWizard Battery plugin
Posted: Tuesday 27 May 2025 19:50
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!
Re: HomeWizard Battery plugin
Posted: Tuesday 27 May 2025 20:14
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.
Re: HomeWizard Battery plugin
Posted: Wednesday 28 May 2025 15:41
by rini52
Thanks for the example.
Attached I included tthe percentage as well.
Regards
Re: HomeWizard Battery plugin
Posted: Monday 23 June 2025 9:29
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
Re: HomeWizard Battery plugin
Posted: Tuesday 01 July 2025 4:20
by mvdp

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