It deals with a (NPN) pulse counter for watermeter and deals with the P1 port of my Smartmeter. The advantage is.. It is now wirelessly accessible.
The board was designed to use MySensors, but as this is an ESPEasy forum... I wanted to give it a try.
Main idea is to setup a ser2net server to pass the P1 data on to Domoticz for calculation.
And setup a pulse counter to read my watermeter.
It has the following rules.
It just counts every pulse from the watermeter and stores that value in a dummy counter. Every minute the dummy counter data is send to Domoticz. In this way you have flow (amount of liters / minute) as well in domoticz.
Code: Select all
//------------ INITIAL RELEASE On System#Boot do // When the ESP boots, do TaskValueSet 4,1,0 // TaskValueSet TASKnr,VARnr,Value, Reset the Liters counter to 0 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 // Only send value if amount of Liters > 0 else 'keep the change ;-)' SendToHTTP 192.168.2.89,8080,/json.htm?type=command¶m=udevice&idx=<youridx>&nvalue=0&svalue=[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