Water meter ESPeasy Wemos TCRT5000 WIFI

Everything about esp8266 and more.

Moderator: leecollings

Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by Justintime »

sincze wrote: Thursday 30 May 2019 18:59 Image of your devices in espeasy would come in handy now :)

if typo then no calculation :)
I have checked typo 100 times....i just copy and pasted IDX 501 is the Incemental counter and IDX 502 dummy waterflow.

Code: Select all

On System#Boot do     							// When the ESP boots, do
   TaskValueSet 4,1,0							// TaskValueSet TASKnr,VARnr,Value, Reset the Liters counter to 0
   TaskValueSet 4,2,0							// Previous Counter used for memory 
   TimerSet,1,60      								// Set Timer 1 for the next event in 60 seconds
EndOn
 
On Watermeter#Count do						// When Pulse is detected
	if [Watermeter#Count] > 0
		TaskValueSet 4,1,[Watermeter#Count]		// Set the Pulse to the Liters dummy sensor
	endif
EndOn

on Rules#Timer=1 do  							// When Timer 1 expires, do
	if [Liters#Liters] > 0 or [Liters#Previous] > 0		// Only send value if amount of Liters > 0 else 'keep the change ;-)'
		SendToHTTP 192.168.1.XX,XX,/json.htm?type=command&param=udevice&idx=502&nvalue=0&svalue=[Liters#Liters]
		TaskValueSet 4,2,[Liters#Liters]
		TaskValueSet 4,1,0						// TaskValueSet TASKnr,VARnr,Value, Reset submitted Liters counter to 0
	endif
	TimerSet,1,60      							// Set Timer 1 for the next event in 60 seconds
endon
Attachments
Naamloos.png
Naamloos.png (42.46 KiB) Viewed 5083 times
Aantekening 2019-05-30 192341.png
Aantekening 2019-05-30 192341.png (47.28 KiB) Viewed 5083 times
Aantekening 2019-05-30 192312.png
Aantekening 2019-05-30 192312.png (50.61 KiB) Viewed 5083 times
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by sincze »

Question Why are you using:

Code: Select all

		TaskValueSet 4,2,[Liters#Liters]
		TaskValueSet 4,1,0
It seems your liters device is not at device number 4 but number 2 ?
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.
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by Justintime »

sincze wrote: Thursday 30 May 2019 19:57 Question Why are you using:

Code: Select all

		TaskValueSet 4,2,[Liters#Liters]
		TaskValueSet 4,1,0
It seems your liters device is not at device number 4 but number 2 ?
Ow mannn the lights has come on..... i am not a programmer but now you gave that hint i understand the TasksetValueSet. Again something learned.
Thanks!!! :!: :!: :!:
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by kimot »

All this is very nice, I am using incremental counter for energy consumption for my el. floor heating thermostat.
I am sending values the same way. ( many of them per day ).
BUT.
Now I have got new sensor - water tank level and consumption measuring.
And because I only send one to two values ​​a day, I found wrong function for incremental counter.
You can see here:

https://www.domoticz.com/forum/viewtopi ... =6&t=28345
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
Jojik1
Posts: 16
Joined: Monday 06 January 2020 23:57
Target OS: -
Domoticz version:
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by Jojik1 »

Please, does anyone know why I have ESP in "Generic - Dummy Device / Liters"
one VALUES item??
How can I add more?
The m3 measurement already works perfectly.
values.png
values.png (14.63 KiB) Viewed 3724 times
Jojik1
Posts: 16
Joined: Monday 06 January 2020 23:57
Target OS: -
Domoticz version:
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by Jojik1 »

OK then!
Output Data Type: Triple
according to the instructions was Single
lazaruss72
Posts: 17
Joined: Thursday 14 December 2017 23:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by lazaruss72 »

hello,

this thread is really very good and has helped me a lot with my project.
i used a proximity sensor LJ18A3-4-Z-BX instead of the infrared sensor TCRT5000. This works very well.

@sincze: thanks a lot for the waterflow script. that works decent too. but i have a question about that and maybe someone can help me:

The waterflow counter (dummy device in ESPEasy and domoticz) always stays at the last value, even if no water is running.
water1.png
water1.png (8.03 KiB) Viewed 3510 times
water2.png
water2.png (9.76 KiB) Viewed 3510 times

in line 17 the counter is actually reset, isn't it?
(TaskValueSet 2,1,0)

Code: Select all

On System#Boot do     							// When the ESP boots, do
   TaskValueSet 2,1,0							// TaskValueSet TASKnr,VARnr,Value, Reset the Liters counter to 0
   TaskValueSet 2,2,0							// Previous Counter used for memory 
   TimerSet,1,60      								// Set Timer 1 for the next event in 60 seconds
EndOn
 
On Watermeter#Count do							// When Pulse is detected
	if [Watermeter#Count] > 0
	   TaskValueSet 2,1,[Watermeter#Count]		// Set the Pulse to the Liters dummy sensor
	endif
EndOn

on Rules#Timer=1 do  							// When Timer 1 expires, do
	if [Liters#Liters] > 0 or [Liters#Previous] > 0		// Only send value if amount of Liters > 0 else 'keep the change ;-)'
		SendToHTTP 192.168.0.xx:8080/json.htm?type=command&param=udevice&idx=651&nvalue=0&svalue=[Liters#Liters]
		TaskValueSet 2,2,[Liters#Liters]
		TaskValueSet 2,1,0						// TaskValueSet TASKnr,VARnr,Value, Reset submitted Liters counter to 0
    	endif
       TimerSet,1,60      						// Set Timer 1 for the next event in 60 seconds
endon

Hopefully someone knows advice


many greetings
lazarus
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by sincze »

Mmm should go back to 0 indeed
Watermeter.JPG
Watermeter.JPG (90.65 KiB) Viewed 3509 times
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.
User avatar
cyberclwn
Posts: 103
Joined: Thursday 20 August 2015 22:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by cyberclwn »

Hi,

Maybe the issue is that in your screenshot the counter is called "Liter", and in script you use "Liters"?

Code: Select all

[Liters#Liters]
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by sincze »

:lol: :D excellently spotted.
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.
lazaruss72
Posts: 17
Joined: Thursday 14 December 2017 23:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by lazaruss72 »

I am such a dork :lol: :lol: :lol:
thank you very much for the help.
After the change and a reboot the correct values are displayed in the log and the variables are filled correctly.
However, I now have a very strange error message and nothing is transferred to domoticz:
water3.png
water3.png (64.4 KiB) Viewed 3501 times
the rules state it correctly

Code: Select all

on Rules#Timer=1 do  							// When Timer 1 expires, do
	if [Liters#Liters] > 0 or [Liters#Previous] > 0		// Only send value if amount of Liters > 0 else 'keep the change ;-)'
		SendToHTTP 192.168.0.23:8080/json.htm?type=command&param=udevice&idx=651&nvalue=0&svalue=[Liters#Liters]
		TaskValueSet 2,2,[Liters#Liters]
		TaskValueSet 2,1,0						// TaskValueSet TASKnr,VARnr,Value, Reset submitted Liters counter to 0
        endif
       TimerSet,1,60      							// Set Timer 1 for the next event in 60 seconds
endon
another misspelling?

i have already created a new ruleset, re-entered the command, turned rules off and on again, rebooted. nothing changes this message. as soon as values are to be transferred this error comes up....
lazaruss72
Posts: 17
Joined: Thursday 14 December 2017 23:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by lazaruss72 »

I figured out that the SendToHTTP command is not necessary.
the value is already sent to the stored controller via HTTP. in the dummy sensor the IDX is specified.

I have removed the line and it runs quite well so far.
water4.png
water4.png (59.74 KiB) Viewed 3500 times
User avatar
cyberclwn
Posts: 103
Joined: Thursday 20 August 2015 22:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by cyberclwn »

lazaruss72 wrote: Wednesday 30 December 2020 17:44
the rules state it correctly

Code: Select all

...
SendToHTTP 192.168.0.23:8080/json.htm?type=command&param=udevice&idx=651&nvalue=0&svalue=[Liters#Liters]
...
another misspelling?
Uh, well ... actually ... yes :lol:

I see you fixed it without the SendToHTTP, which is also good.
But if you want to use SendToHTTP again, the syntax is like:

Code: Select all

SendToHTTP 192.168.0.23,8080,/json.htm?type=command&param=udevice&idx=651&nvalue=0&svalue=[Liters#Liters]
Seperate <ip>,<port>,<url> with comma's
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
lazaruss72
Posts: 17
Joined: Thursday 14 December 2017 23:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by lazaruss72 »

Seperate <ip>,<port>,<url> with comma's
this is so diabolical
:evil: :evil:
lamama1234
Posts: 14
Joined: Tuesday 17 October 2017 9:02
Target OS: Windows
Domoticz version:
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by lamama1234 »

sincze wrote: Wednesday 11 July 2018 20:30
JHO01 wrote: Tuesday 10 July 2018 23:14 Why not , do you mind sharing the code for the rules?
Sure.

Code: Select all

On System#Boot do     							// When the ESP boots, do
   TaskValueSet 4,1,0							// TaskValueSet TASKnr,VARnr,Value, Reset the Liters counter to 0
   TaskValueSet 4,2,0							// Previous Counter used for memory 
   TimerSet,1,60      								// Set Timer 1 for the next event in 60 seconds
EndOn
 
On Watermeter#Count do						// When Pulse is detected
	if [Watermeter#Count] > 0
		TaskValueSet 4,1,[Watermeter#Count]		// Set the Pulse to the Liters dummy sensor
	endif
EndOn

on Rules#Timer=1 do  							// When Timer 1 expires, do
	if [Liters#Liters] > 0 or [Liters#Previous] > 0		// Only send value if amount of Liters > 0 else 'keep the change ;-)'
		SendToHTTP 192.168.***.***,8080,/json.htm?type=command&param=udevice&idx=****&nvalue=0&svalue=[Liters#Liters]
		TaskValueSet 4,2,[Liters#Liters]
		TaskValueSet 4,1,0						// TaskValueSet TASKnr,VARnr,Value, Reset submitted Liters counter to 0
	endif
	TimerSet,1,60      							// Set Timer 1 for the next event in 60 seconds
endon
Remember that you need an additional device to do the counting!
Wemos_Domoticz.JPG
Hi sincze & sorry for resuscitating this old post.

I followed your good guidelines, but noticed that your ESPEasy code only send actual water usage data to Domoticz. Did you have add data for water flow, i.e. liters per minutes?

Thanks
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by sincze »

Yes every minute I send the used amount of liters (= volume).
In domoticz I add that amount to the watermeter value for the total counter to be increased.
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.
azonneveld
Posts: 157
Joined: Wednesday 02 October 2019 7:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands
Contact:

Re: Water meter ESPeasy Wemos TCRT5000 WIFI

Post by azonneveld »

I recently switched from using a prox (hall sensor) to this infrared version.
At first the counts were off but after changing settings, the reading is now accurate.
Settings are in the attachment.

I am using espeasy on a nodemcu v2 to read the sensor.
ESP software: ESP_Easy_mega_20210503_normal_ESP8266_4M1M
Attachments
2021-09-03 16_41_27-Sonoff_Watermeter — Mozilla Firefox.png
2021-09-03 16_41_27-Sonoff_Watermeter — Mozilla Firefox.png (22.98 KiB) Viewed 3153 times
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests