All in One NPN Watermeter and P1 Smartmeter

Moderators: grovkillen, TD-er, Stuntteam

Post Reply
Message
Author
sincze
Normal user
Posts: 28
Joined: 15 Jul 2016, 12:54

All in One NPN Watermeter and P1 Smartmeter

#1 Post by sincze » 19 Aug 2018, 13:53

A friend of mine created this nice little board.
1
1
ESP_AIO.jpg (182.25 KiB) Viewed 5820 times

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. :D


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.
Workings:
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&param=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
I've setup a pdf with the instructions. But seem unable to add it to this post. If people are interested I can share it.

MaikelK
Normal user
Posts: 11
Joined: 20 Jun 2017, 19:56

Re: All in One NPN Watermeter and P1 Smartmeter

#2 Post by MaikelK » 20 Aug 2018, 18:37

Yes, highly interested!

sincze
Normal user
Posts: 28
Joined: 15 Jul 2016, 12:54

Re: All in One NPN Watermeter and P1 Smartmeter

#3 Post by sincze » 20 Aug 2018, 19:14

MaikelK wrote:
20 Aug 2018, 18:37
Yes, highly interested!
No problem
Can you send me a PM with your mail. :D
I'll attach it to the email as it seems I am unable upload the document as .pdf unfortunately.

Jazzle
Normal user
Posts: 21
Joined: 07 Mar 2017, 11:12

Re: All in One NPN Watermeter and P1 Smartmeter

#4 Post by Jazzle » 20 Aug 2018, 19:54

Nice, interested too!
Domoticz @ Raspberry Pi 3 - RFXcom @ 433MHz - RFLink @ 868MHZ - ESP8266

sincze
Normal user
Posts: 28
Joined: 15 Jul 2016, 12:54

Re: All in One NPN Watermeter and P1 Smartmeter

#5 Post by sincze » 20 Aug 2018, 20:07

Jazzle wrote:
20 Aug 2018, 19:54
Nice, interested too!
No problem
Can you send me a PM with your mail. :D
I'll attach it to the email as it seems I am unable upload the document as .pdf unfortunately.

TD-er
Core team member
Posts: 2625
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: All in One NPN Watermeter and P1 Smartmeter

#6 Post by TD-er » 21 Aug 2018, 08:12

If you like, I can also add it to the wiki as an example project.

Jazzle
Normal user
Posts: 21
Joined: 07 Mar 2017, 11:12

Re: All in One NPN Watermeter and P1 Smartmeter

#7 Post by Jazzle » 21 Aug 2018, 08:18

sincze wrote:
20 Aug 2018, 20:07
Jazzle wrote:
20 Aug 2018, 19:54
Nice, interested too!
No problem
Can you send me a PM with your mail. :D
I'll attach it to the email as it seems I am unable upload the document as .pdf unfortunately.
Sorry, did send a pm directly after my post. Now i see it is still in my outbox

my mail address is dijkstra underscore jasper at outlook dot com
Last edited by Jazzle on 21 Aug 2018, 12:05, edited 1 time in total.
Domoticz @ Raspberry Pi 3 - RFXcom @ 433MHz - RFLink @ 868MHZ - ESP8266

MaikelK
Normal user
Posts: 11
Joined: 20 Jun 2017, 19:56

Re: All in One NPN Watermeter and P1 Smartmeter

#8 Post by MaikelK » 21 Aug 2018, 11:53

My Pm is also hanging in the outbox.
If you could send it to maikel underscore Kooij at hotmail dot com that would be nice!

andreo
Normal user
Posts: 8
Joined: 22 Sep 2015, 23:56

Re: All in One NPN Watermeter and P1 Smartmeter

#9 Post by andreo » 15 Sep 2018, 23:48

Please send me a copy of your pdf, send you a PM
Last edited by andreo on 01 Oct 2018, 21:34, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3583
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: All in One NPN Watermeter and P1 Smartmeter

#10 Post by grovkillen » 16 Sep 2018, 07:34

andreo wrote:
15 Sep 2018, 23:48
My PM is also hanging in the outbox.
Please send me a copy of your pdf to oerlemans dot andre AT gmail dot com
They will "hang" there until the recipient has open it. Not logical I know but that's phpBB for ya :)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ObiToo
Normal user
Posts: 1
Joined: 03 Nov 2019, 15:30

Re: All in One NPN Watermeter and P1 Smartmeter

#11 Post by ObiToo » 03 Nov 2019, 19:34

Hi, is it still working well ?
Can you help me with a pdf ?

Kind regards
Hans

MarcelM
Normal user
Posts: 16
Joined: 15 Dec 2019, 14:41

Re: All in One NPN Watermeter and P1 Smartmeter

#12 Post by MarcelM » 18 Dec 2019, 15:07

I use the a NPN sensor with a 8266 Wemos mini d1 to read my watermeter.
The sensor is placed in the watermeterlid.
Sensor see: https://benselectronics.nl/inductieve-p ... ensor-npn/
It works great withe ESPmega.

The NPN sensor needs 6 volts, so i use a 6 volts supply for both 8266 and NPN sensor.
The data signal is devided by 2 by two resistors 10K (data signal must not exceed 3V).
Every minute the pulses are read on GPIO by the ESP task "Generic - Pulse counter"
Each pulse represents one liter.

I need resident counter representing the watermeter counter.
The pulse counter increments the meter counter.

My question: is it possible in ESP mega to have a user variable which survives an ESP reboot?

TD-er
Core team member
Posts: 2625
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: All in One NPN Watermeter and P1 Smartmeter

#13 Post by TD-er » 18 Dec 2019, 16:44

As long as the unit remains powered, then you could store the value in a dummy, but also the other plugin output values should survive a reboot.
These are stored in RTC memory, and restored at boot, but this memory does need power.

MarcelM
Normal user
Posts: 16
Joined: 15 Dec 2019, 14:41

Re: All in One NPN Watermeter and P1 Smartmeter

#14 Post by MarcelM » 19 Dec 2019, 00:20

What do you mean with "the other plugin output values" ?

TD-er
Core team member
Posts: 2625
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: All in One NPN Watermeter and P1 Smartmeter

#15 Post by TD-er » 19 Dec 2019, 14:26

MarcelM wrote:
19 Dec 2019, 00:20
What do you mean with "the other plugin output values" ?
A task does output up-to 4 values.
Often these are sensor values like temp/hum etc.
So every value you can set in a task as output value is also stored in RTC memory.

MarcelM
Normal user
Posts: 16
Joined: 15 Dec 2019, 14:41

Re: All in One NPN Watermeter and P1 Smartmeter

#16 Post by MarcelM » 19 Dec 2019, 18:10

Oke I understand, RTC memory values can survive deep sleep.
Is there also a memory for users which survives a reboot, like the config parms.

TD-er
Core team member
Posts: 2625
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: All in One NPN Watermeter and P1 Smartmeter

#17 Post by TD-er » 19 Dec 2019, 21:39

MarcelM wrote:
19 Dec 2019, 18:10
Oke I understand, RTC memory values can survive deep sleep.
Is there also a memory for users which survives a reboot, like the config parms.
Nope, not yet.
I do have plans to support FRAM and/or EEPROM for this, but that's a future new feature :)

MarcelM
Normal user
Posts: 16
Joined: 15 Dec 2019, 14:41

Re: All in One NPN Watermeter and P1 Smartmeter

#18 Post by MarcelM » 20 Dec 2019, 16:50

:idea: That would be nice.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 14 guests