Page 2 of 2
Re: Watermeter through GPIO and TCRT5000
Posted: Saturday 18 February 2017 22:30
by sincze
joostnl wrote:Can someone write me a step guide to install, Isrcounter.
My script for water is working only i want to make it more accurate
It was a bit hidden I have to agree
viewtopic.php?f=32&t=3151&start=60#p112272
Re: Watermeter through GPIO and TCRT5000
Posted: Friday 21 July 2017 13:14
by heggink
I attached the tcrt through espeasy to domoticz. I experience a weird consistenr ~6% higher reading in domoticz than the real consumption. Consistent enough to make me wonder if it's really the reflection meter edge that could cause it. Any thoughts?
H
Re: Watermeter through GPIO and TCRT5000
Posted: Sunday 23 July 2017 11:33
by sincze
heggink wrote:I attached the tcrt through espeasy to domoticz. I experience a weird consistenr ~6% higher reading in domoticz than the real consumption. Consistent enough to make me wonder if it's really the reflection meter edge that could cause it. Any thoughts?
H
Did you connect directly to EspEasy or also used a resistor (pull down).
I know that having this sensor exposed to external light (lightning) will increase the usage as well.
So I covered mine. I am not using the Espeasy though and have been running the tcrt5000 for 2 years now.
It works like a Swiss clock.

Re: Watermeter through GPIO and TCRT5000
Posted: Wednesday 23 August 2017 12:23
by heggink
Turned out that the esp module was faulty and generated lots of bogus counts. Probably a broken lead somewhere which was really difficult to track down.
Re: Watermeter through GPIO and TCRT5000
Posted: Saturday 02 September 2017 22:06
by pvangorp
commandArray = {}
print('> Monitoring water consumption')
-- Water usage
-- Retrieve value from water meter device:
sWaterUsage = otherdevices_svalues['Water']
-- To have a better readable format, divide number by 1000:
sWaterUsagePrint = tonumber(sWaterUsage / 1000);
-- calculation is done with the unmodified water value
sWaterUsage = tonumber(sWaterUsage);
print(">> Utilities: Water usage until now is " .. sWaterUsagePrint .. " ");
if (devicechanged['GPIO_WATER'] == 'Close')
then
sWaterUsageTot = (sWaterUsage + 1)
print(">> Utilities: Water usage is now " .. sWaterUsageTot .. " ");
commandArray['UpdateDevice'] = '164|0|'..sWaterUsageTot..''
end
return commandArray
I changed the code in red. This function is designed for it. When using a test and production environment you don't need to update the IP address.