Page 2 of 3

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Friday 21 April 2023 21:51
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 3084 times

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Friday 21 April 2023 21:56
by FireWizard
Hello @mvveelen,

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

Regards

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Friday 21 April 2023 22:02
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.

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Sunday 14 May 2023 15:58
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 (' ')
 

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Sunday 14 May 2023 19:47
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 3012 times
Haven't changed the rights of the file water.lua by the way, so what you have should be OK.

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Sunday 14 May 2023 23:43
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.

Re: Add HomeWizard WiFi watermeter in Domoticz

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

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Tuesday 06 June 2023 0:04
by heggink
Just got the device and installed the plugin. World really nicely! Thx!!

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Monday 14 August 2023 13:38
by sincze
Yes the mentioned P1 & Watermeter plugin are working excellent ;-)

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Wednesday 30 August 2023 9:09
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

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Wednesday 30 August 2023 9:19
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.

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Wednesday 30 August 2023 10:26
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..

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Tuesday 03 October 2023 17:56
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..?

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Tuesday 03 October 2023 18:23
by waltervl
The offset value is available on the counter device.

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Tuesday 03 October 2023 18:24
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

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Tuesday 03 October 2023 19:50
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!

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Monday 18 December 2023 13:11
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 2294 times

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Monday 18 December 2023 14:57
by FireWizard
Hi,

Could this be due to settings?
Yes

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

Regards

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Monday 18 December 2023 20:03
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.

Re: Add HomeWizard WiFi watermeter in Domoticz

Posted: Monday 18 December 2023 21:33
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