HomeWizard Battery plugin

Python and python framework

Moderator: leecollings

fdemees
Posts: 35
Joined: Sunday 29 March 2020 17:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Belgium, close to Brussels
Contact:

Re: HomeWizard Battery plugin

Post by fdemees »

DomoFlits wrote: Wednesday 10 June 2026 16:24 API v2 gives you more options
Indeed.
/api/batteries is an API V2 command which works only with the P1 dongle. It is unsupported in API V1 and does not work with the batteries themselves.

The batteries have their own API: /api/measurement , but this is only a reporting function.

If you want to interact (e.g. charge only, discharge only, stand by) you can only talk to the P1 dongle and it will treat all batteries as a global entity.
Domoticz on Rpi 3B+, ZigbeeforDomoticz, Sonoff Zigbee coordinator, several Sonoff/ESPEasy/Tasmota, IPX800, several Zigbee things, Ksenia Lares, HomeWizard batteries
mvdp
Posts: 25
Joined: Sunday 07 October 2018 17:21
Target OS: Linux
Domoticz version: 2025.1
Location: Bollenstreek
Contact:

Re: HomeWizard Battery plugin

Post by mvdp »

fdemees wrote: Wednesday 10 June 2026 15:22 ...
I have tried HomeWizard-Battery-plugin > examples > dzEvent.lua from @mvdp
(https://github.com/etmmvdp/HomeWizard-B ... zEvent.lua) which returns errors.
...
error messages:

Code: Select all

2026-06-10 15:19:30.487 Error: EventSystem: Lua script dz HW Batteries total did not return a commandArray
2026-06-10 15:19:30.495 Error: EventSystem: Lua script dz HW Batteries total did not return a commandArray 
...
...
Moreover this value (48.295 kwh) is useless as a source for generating the energy dashboard.
Instead, the 5th field in the array provided in the "Total Power" contains the useful data (280 watts). The sum of all 3 batteries could be used.
(I don't know how to handle these arrays in scripting - sorry).
...
Hello Frédéric,

Thanks for the feedback. I'll address your questions and remarks:

* Did you change the device numbers for the batteries in the lua script?
I.e. the values 1827, 1828 should be adapted to the device ids used in your setup. Also, the script has to be wrapped in "return
{ ...}" block. That part is missing from your code block.

* Next, regarding the `Batteries Active Power` remark, this is a field that is returned by the api. I don't want to hide it from the users.
* The usage of the v2 api is considered, but the interface you provided is for the P1 dongle, not the battery, as suggested in the feedback by
fdemees wrote: Wednesday 10 June 2026 17:24
Post Reply