Add HomeWizard WiFi watermeter in Domoticz

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by mvveelen »

Whoops !

In Setup >> Settings >> Meters/Counters I had 1000000 for Water. Probably because I have been experimenting in the past with a Wemos D1 Mini board and a sensor.... The divider was 0, now I have this and I think it's right:
Scherm­afbeelding 2023-04-21 om 21.49.10.png
Scherm­afbeelding 2023-04-21 om 21.49.10.png (114.25 KiB) Viewed 3081 times
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by FireWizard »

Hello @mvveelen,

In this case, I also understand your 1,000.000 :)
I think these values look much more realistic.

Regards
Last edited by FireWizard on Monday 14 August 2023 16:45, edited 1 time in total.
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by mvveelen »

Thanks, I’ll monitor the values the next few days.

Edit: it's OK like this. The values are not very exact though.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
diekli
Posts: 4
Joined: Sunday 16 December 2018 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by diekli »

I've edited my post to include the code brackets,

My - updated and now working - script is listed below.


*******

Manual JSON request from a browser:
{"wifi_ssid":"XXX","wifi_strength":32,"total_liter_m3":0.087,"active_liter_lpm":0,"total_liter_offset_m3":0}



Domoticz versie: 2023.1

HTTP Poller: GET
Content type: application/json
URL: http://192.168.X.Y/api/v1/data
Command: water.lua

Directory: /home/pi/domoticz/scripts/lua_parsers
4 -rw-r--r-- 1 root root 843 May 14 15:30 water.lua

Code: Select all

-- Read API values
s = request['content'];

PRINT_MODE = true --true false  -- when true print all used values

print('Water script')

local info = debug.getinfo(1,'S');

if PRINT_MODE == true then
print (' ')
 print('*** Start van ' .. info.source .. ' script')
print ('Json response: ' .. s)
end


--
-- Watermeter
--
local idWater = 46
local a = domoticz_applyJsonPath(s,'.active_liter_lpm')
domoticz_updateDevice(idWater,'',a)

if PRINT_MODE == true then
 print('Waterverbruik:  ' .. a)
end

local idWaterTotaal = 45
local b = domoticz_applyJsonPath(s,'.total_liter_m3')
domoticz_updateDevice(idWaterTotaal,'',b)

if PRINT_MODE == true then
 print('Totaal water verbruikt:  ' .. b)
end

if PRINT_MODE == true then
print('*** Einde  van ' .. info.source .. ' script')
 print (' ')
 
Last edited by diekli on Sunday 14 May 2023 23:47, edited 1 time in total.
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by mvveelen »

Hi, please use the 'code' brackets when you post code and also try to use English here.

Do you use other LUA scripts that work? In other words, is LUA activated in Domoticz?
Do you receive errors or no messages at all?

My code:

Code: Select all

-- Read API values
s = request['content'];

--
-- Watermeter
--
local idWater = 2099
local a = domoticz_applyJsonPath(s,'.active_liter_lpm')
domoticz_updateDevice(idWater,'',a*1)

local idWaterTotaal = 2100
local b = domoticz_applyJsonPath(s,'.total_liter_m3')
domoticz_updateDevice(idWaterTotaal,'',b*1000)

local idWaterVerbruik = 2101
local c = domoticz_applyJsonPath(s,'.total_liter_m3')
domoticz_updateDevice(idWaterVerbruik,'',c*1000)
My devices:
Scherm­afbeelding 2023-05-14 om 19.44.37.png
Scherm­afbeelding 2023-05-14 om 19.44.37.png (58.8 KiB) Viewed 3009 times
Haven't changed the rights of the file water.lua by the way, so what you have should be OK.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
diekli
Posts: 4
Joined: Sunday 16 December 2018 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by diekli »

Hi,

Apologies for not using the right brackets !

The solution: the following line was a comment, I guess that prevented the main part of the code from running.
Correct line below.

Code: Select all

local info = debug.getinfo(1,'S');
Thank you for responding.
Eraser
Posts: 24
Joined: Friday 13 January 2017 9:24
Target OS: Windows
Domoticz version: 3.8153
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by Eraser »

I have written a Python plugin for the watermeter. Check the HomeWizard Wi-Fi Watermeter on Github.
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by heggink »

Just got the device and installed the plugin. World really nicely! Thx!!
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by sincze »

Yes the mentioned P1 & Watermeter plugin are working excellent ;-)
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by CronoS »

Is it possible to use this HomeWizard watermeter if I do not have anything else from HomeWizard I do not have a subscription with them. I am interested to set up this watermeter in combination with domoticz
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by sincze »

CronoS wrote: Wednesday 30 August 2023 9:09 Is it possible to use this HomeWizard watermeter if I do not have anything else from HomeWizard I do not have a subscription with them. I am interested to set up this watermeter in combination with domoticz
Yes, I have only their (P1 and Watermeter) devices.
You only need their APP to set it up but that is basically it.
Then you can cut Internet connection for the device and use it locally.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by CronoS »

sincze wrote: Wednesday 30 August 2023 9:19
CronoS wrote: Wednesday 30 August 2023 9:09 Is it possible to use this HomeWizard watermeter if I do not have anything else from HomeWizard I do not have a subscription with them. I am interested to set up this watermeter in combination with domoticz
Yes, I have only their (P1 and Watermeter) devices.
You only need their APP to set it up but that is basically it.
Then you can cut Internet connection for the device and use it locally.
Thanks for the answer. So you don't need to have the P1 meter with it? Only you need the app during the initial setup, afterwards you don't need it anymore... That is great..
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by CronoS »

FireWizard wrote: Friday 30 December 2022 15:06 Hello @Hesmink

Go to your Watermeter widget and click "Edit".


Screenshot_WaterUsage_Widget.png


The "Configuration" screen will open and insert the desired value.


Screenshot_WaterUsage_Widget_Config.png


Insert the desired "Meter Offset" and click "Update".

Regards
I don't get It.. I don't see the Meter offset in my widget? Any Idea? I have added a Custom sensor with m3 as label. It is a General / Custom Sensor. The device updates OK; but I cannot set the offset on the device because the value is not the same as in the Homewizard app..?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by waltervl »

The offset value is available on the counter device.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by FireWizard »

Goodevening @CronoS,

If you had read the thread from the beginning, you would have found the following line in a post of @Hesmink (30 december 2022).
Got it. As per OP, I used the custom sensor, and you cannot add the offset there. I now updated it to a counter of type water. Issue solved, thanks.
So the "Custom"sensor is the wrong choice.
Use a counter and configure it as water.

Regards
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by CronoS »

FireWizard wrote: Tuesday 03 October 2023 18:24 Goodevening @CronoS,

If you had read the thread from the beginning, you would have found the following line in a post of @Hesmink (30 december 2022).
Got it. As per OP, I used the custom sensor, and you cannot add the offset there. I now updated it to a counter of type water. Issue solved, thanks.
So the "Custom"sensor is the wrong choice.
Use a counter and configure it as water.

Regards
Sorry; my mistake. I only have red the first page ;) hahaha.. I even didn't saw that there was already a plugin now. Installed it and seems to work OK.. Thanks!
bvdf0251
Posts: 24
Joined: Saturday 09 July 2022 14:38
Target OS: -
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by bvdf0251 »

Eraser wrote: Saturday 03 June 2023 15:15 I have written a Python plugin for the watermeter. Check the HomeWizard Wi-Fi Watermeter on Github.
Hi Eraser,

This is great, my usage is only shown rounded to 10's

So 100 liters, of 320 etc. Never 44 liter or 182.

Could this be due to settings?
Meter counter divider settings
Meter counter divider settings
Screenshot_20231218_132047_Chrome.jpg (77.63 KiB) Viewed 2291 times
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by FireWizard »

Hi,

Could this be due to settings?
Yes

Change the setting for "Water" to 1000 instead of 100.

Regards
bvdf0251
Posts: 24
Joined: Saturday 09 July 2022 14:38
Target OS: -
Domoticz version:
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by bvdf0251 »

Thanks FireWizard,

Would that mean my data so far should be deleted.

As it's now showing 50 liters today where the original was 500~

Family of 4 all showered today and the washer machine ran several times today.

So 500 is about right.
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Add HomeWizard WiFi watermeter in Domoticz

Post by FireWizard »

Hi @bvdf0251,

Technically it is not necessary to delete existing data, as long as you realise that the data so far is incorrect. This data should not be used for any comparison..

To avoid mistakes, I would recommend to delete the data and start from scratch.
Do not forget to insert a correct off-set.

Regards
Last edited by FireWizard on Saturday 04 May 2024 14:01, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests