Water Meters with pulse output have two leads. They generate a simple pulse.

The MySensors circuit also should also work with two leads - just need to know which two. The three leads are for water meters with no pulse output and where you need an optical sensor to sense the moving wheel.

Hi.
Cant get my watersensor to send any values.
I have debug enabled and it seems like it communicates fine with the gw but no flow data are beeing reported to the gw or the serial monitor.
TSP:MSG:SEND 4-4-0-0 s=1,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=ok:
Anyone else experienced this problem?

I wanted to operate my water pulse meter on batteries and also get the water flow. The original design had the following issues with that:

Incorrect flow calc: micros() was used to calculate the flow, however micros() wraps every 70 minutes which looks like a huge flow (which is then discarded in code)

Volume calc: millis() wraps every 50 days which is not handled correctly either

Too much current for battery use: The IR LED of the TCRT5000 is always on and the LM393 comparator is also taking a few mA's

Could not report flow in sleep mode because millis() does not increment on sleep - need to do this based on calculation of total sleep time. We now simply calculate the number of pulses per minute and deduct the flow

I also had issued with the data transport reliability, so I added error counters (which show up on the Gateway as distance sensors)

I also wanted to provide a measurement counter to the gateway (that counts up each time a message is sent)

The sensor will reboot itself when too many errors occur

So I modified the circuit of the IR sensor:

Assumption that the wheel of the water meter turns slowly (takes at least a few seconds to turn around)

We will wake up every 500 millisecond to turn on the IR LED connected to PIN 8. Pin 8 also powers the photo transistor that measures the reflection

I removed the power from the opamp circuit that is linked to the photo transistor

The voltage from the photo transistor is then read using an analog read on A1. Based on a threshold value we will deduct if the mirror on the water meter is in view

Pin 7 is connected to a learning switch which will turn the device in a specific mode and the min/max values on A1 are used to calculate the value of the threshold (which is then stored in the EEPROM)

After 30 seconds in learning mode, the new threshold is established and the LED on Pin 6 will show the actual on/off mirror signals, so you can see the pulses are correctly counted

switch back the DIP switch on Pin 7 to bring back normal mode

The circuit also contains the battery voltage sensor circuit (I am using a 1.5V battery and step up circuit). So the resistors used are 470k from + pole of battery to the A0 input and 1 M ohm from A0 to ground

@mfalkvidd - I did measure the average current consumption at the time, but I not remember the exact value. I believe it was well below the 0.5 mA. The sensor has been up and running on the same single 1.5V AA battery for 30 days now and the batt percentage still shows 93%.

I hope this is not off topic but I'm trying to read our gas meter - but....I cannot use a photo sensor or a hall sensor or a reed switch (the meter is outside and there is no magnet in it). I was able to get some good data using a magnetometer (https://www.sparkfun.com/tutorials/301) using an arduino. But I tink from what I am told is the arduino isn't big enough to handle the code I need to use to change the data (x axis, y axis, z axis) into a pulse but will work on a pi.

My question is am I missing something (hardware guy, not software)? Can I use a Pi for a sensor (it has the inputs and room), all the code on this site is for arduinos. Could I have the Pi output a pulse to an arduino? Am I over thinking this?

@dpcreel. I would be surprised the Arduino could not handle the HMC5883L magnetometer from Sparkfun. The I2C protocol is natively supported and you only need to analyse numbers coming from the 3-Axis to decide when the wheels inside the gas meter turn. I think the position of the sensor will be very critical, but the code should not be too complex. Arduino's are typically limited in handling much data (there is only 2000 bytes of RAM in the ATmega328), but your code should not need much RAM space. The program size can be 32 KB which should be enough.

If you want to go for the PI, there are I2C libraries out there you could use and I would then bypass the Mysensors gateway alltogether and connect an ethernet cable to the PI and use the MQTT protocol to talk to your home controller.

@bart59 The Arduino works fine with the HMC5883L, I got some good data from it and was able to "see" the gas meter movements very well. I am not able to write code (hardware guy) to change this data to a pulse for MySensors or whatever it needs. I just want to be able to read my gas meter with the HMC5883L. I did find some code in python that works on the pi, that's why I mentioned it. I'm a hack at software.

Task:
Need to connect Siemens WFK2 water meters (four of them actually) with pulse outputs (2 line). According to data sheet (link text) there are two types: reed output or NAMUR.

To start with, I connected the reed output of the water meter via 10k resistor to +5V, GND and D3. Again, according to data sheet, for every 10l the water meter should give an impulse (e.g. connect the switch). Taking this into account I have adjusted pulse factor to 100 and based on Nominal Flow Rate (Max Flow Rate impossible in my case) limited Max Flow to 25 l/min. This setup works, but I definitely get wrong flow values (e.g. with constant flow of 6l/min serial monitor and domoticz report anything between 12-15l/min) and also wrong water usage m3 and litre usage in Domoticz.

When trying to debug, found out following behaviour (must be connected to Pulse length an Qn from data sheet IMHO):
with each turn it indeed switches on, e.g. shortens the contacts which generates pulse for the sensor, however it takes up to 2-4 litres until switch is in the off state.

As a result you might have a situation when meter switches on, one closes the tap, and the signal is on for minutes/hours until tap is again opened and 2-4 litres have been used, after which signal will switch off.

Do I understand correctly that the debouncer which should take care of similar situations is not ready for this?

The original code from the mysensors site does not handle your situation very well (indeed because the switch staying on or off for a long time). You can use my code (see my post further up this discussion). In my case I have a pulse every 1 liter.

In your case you only have 1 pulse every 10 liters, which means you have to take a much longer period to calculate the flow correctly. Basically you have to set MIN_SEND_FREQ to a higher value. The flow is calculated based on the number of pulses in a given time period. Example: with 6 l/min you have to calculate this value only once every 5 minutes (=30 liter = 3 pulses from your Siemens meter) instead of every 30 seconds as I do. So if MIN_SEND_FREQ = 600 (every 5 minutes) your flow is calculated as:

thanks for quick reply. I will try to adjust MIN_SEND_FREQ and use your code.
however, if I understand correctly, with the current logic used its impossible to avoid misinterpretations of pulses in case of very very long on or off state. It will approximate the flow rate to more correct value during usage of water (this is good enough) and should report total usage somehow correctly (this one I would better get as precise as possible). I wonder if the code will capture the correct number of pulses in the case of very long on state.

BTW, I was not able to find a readily available sketch to connect NAMUR output, which is basically 5kOhm off state and 1.5795 kOhm on state. I believe, I will have to calculate required pull up resistance to get a proper voltage divider for 5\3.3v, right?

My code basically measures the time between two upward pulses. You can modify the code to also count the downward pulses. The net effect is that you will get a count every 5 liter (on average), but if there is no flow, the first pulse will always be off by 1-4 liter because you do not know how far the rotation is completed.

On NAMUR: you can actually use my code here too: I use analog input A1 to measure the voltage on the infra red sensor (which varies between 0 and 1.1 Volt). During the learn mode (set with a seaprate DIP switch) the code measures the input voltage for a period of 30 seconds while you turn open the water tap (you may want to increase the timing in your case) and then calculates the average between the lowest and highest voltage as the currect point there is a 1 or 0 coming from the pump (in my case it is an IR LED that is reflecting from a mirror into a photo sensor and the position of the mirror may change - resulting in different voltages).

Would anyone be able to help me get the hall sensor to work to work directly connected to an ESP8266 MQTT gateway? I was able to created the MQTT gateway, appended this sketch to the MQTT gateway sketch and connect the hall sensor DO to D12 (D3 is occupied), but when I subscribe to my mosquitto server no values are published. I am able to see the prefixes and they get published every 20 seconds as expected, but there are no sensor values. I plan on using this with home assistant, incase that helps with the final setup. If anyone has any recommendations it would be greatly appreciated.

I am trying this node. I have it set up. but I am having the same problem as Dirtbag. I am not getting any values. I debugged and I am getting 1 and 0 for my sensor output, so my sensor is working when I trigger it with a magnet.
Does this work with MQTT gateway?? am I missing something. Communication is fine between by ESP gateway and my node.?
Thanks ahead of time for any help with this.

Hi. i'm having a strange problem using a arduino nano connecting a hall sensor to read my water meter. My water meter is dated from 1996 and i can't use the TCRT5000 sensor so i'm trying my luck with the hall sensor. My problem is that my arduino is always sending data.... even if i have the water turned off the most strange thing is that even when the arduino is not connected to the hall sensor it send's data. How can i fix this problem ?

@mfalkvidd Yes i did but has you can see even when the hall sensor is not connected the arduino sends data and the water increases in the the gateway. I can work on the SEND_FREQUENCY and see if it fix this problem.

Have been working with the code and have found one strange thing. When my sensor sends data to the gateway "domoticz" the gateway sends a value to the sensor. The strange thing is that my arduino does not have any sensor connected and sow the data send is zero but my gateway sends akways a positive value and increases this value every time it sends data to the arduino.

Even if i go to the arduino code and set the volume and pulseCount to 0 flash it to the arduino, load the value of zero to the gateway and then e flash the same code but this time i remove the volume and pulseCount to 0 the first time the arduino sends data to the gateway it always receive a value insted of zero since i dont have the hall sensor connected to the arduino.

I'm using a arduino mini pro 3.3v on a easy pcb by soundberg81 and i have setup the digital pin2 to connect the hall sensor.

@mfalkvidd Thanks. Have now connected the digital pin2 to gnd and in the last 1h the values are always 0.000 going to leave it this way until night since now i'm at work. I would like to find out what was creating the spurious interrupts??
Other thing that ill find out tonight is when i connect the sensor to the arduino will it create rong data or will it only send real data only when the water meter starts running water...

One more thing today at 8:00 when i did the pin2 to gnd the first "boot" over domoticz i got this value as you can see on the image below. Is this normal? Have been trying to deleted but it wont go away.

@mrc-core
The spurious interrups are caused by the open line. The Arduino has high impedance inputs and anything from a WiFi signal or the signal from a close by circuit can cause the value to swing between 0 and 3 Volt, triggering your input. See https://www.arduino.cc/en/Tutorial/DigitalPins

On your high value in the graph: Domoticz water sensors require the sensor to post the total water volume. This means that the sensor needs to "know" the total of volumes from all the past measurements. In fact all the (wrong) past pulses you generated with the open input are stored by the sensor. There are 2 ways this storage mechanism can be realized in Arduino code:

(1) keep the value in the Arduino EEPROM and
(2) use a build in feature of Domoticz to store values on behalf of sensors.

Mysesnsors uses method 2 as method (1) has 2 disadvantages: The code needs to continuously write to the EEPROM, because you never know when the Arduino will be rebooted. The EEPROM on the Arduino chip does not allow you to write to it that often (max 100,000 times or so) and the EEPROM is cleared when you update the software. The sketch used by MySensors uses method (2) by sending the pulsecount to the gateway using send(lastCounterMsg.set(pulseCount)) statement at the same time the volume is sent to Domoticz with send(volumeMsg.set(volume, 3)); At each reboot the sensor requests the value of VAR1 from the gateway using request(CHILD_ID, V_VAR1); The sensor does not send any data to the gateway until the gateway has received the counter past value. The receive() function is called by the Mysensor library when data comes back from the gateway. There the pulseCount += gwPulseCount statement adds the value to the pulseCount.

This means the sensor will not be able to "forget" the pulses that came from the period your digital input was not connected.

There are 3 ways to fix this problem:

you can delete your sensor at the Domoticz side (throwing away all history): First power down your Arduino sensor, the go into Domoticz screen and remove the sensor from the Utility screen and then remove the sensor from the Setup->Hardware->MysensorsGW->Setup->Click on your water meter-> delete all Children-> delete the water meter sensor itself. Then power up your Arduino and you will see the sensor show up again.

as above: remove your sensor from the Utilities tab and change the code to give your sensor another new ID. At the top of your code you can put a statement like

#define MY_NODE_ID 10

This will be the ID number that shows in the hardware setup screen in Domoticz for your sensor. If you omit this code MySensors will create a new (unique) code for you. However in my system I prefer to allocate the numbers myself to each sensor. So a quick way to create a brand new sensor history in Domoticz is to simply change the MY_NODE_ID number (change from 10 to 11).

change yuor Arduino code to force a 0 in the VAR1 holding variable for your sensor. You can do that by adding a statement send(lastCounterMsg.set(0)); inside your loop() function (best place is here):

// Only send values at a maximum frequency or woken up from sleep
if (SLEEP_MODE || (currentTime - lastSend > SEND_FREQUENCY)) {
lastSend=currentTime;
send(lastCounterMsg.set(0)); // <--- keep here shortly and remove later
if (!pcReceived) {
//Last Pulsecount not yet received from controller, request it again
request(CHILD_ID, V_VAR1);
return;
}

You will compile and upload this code to your Arduino and let it run for a minute or so, then remove the line and upload the orginal code. You should now be able to remove the data point in Domoticz (by using ctrl-mouseclick on the graphic item)

@bart59 Thanks have done like you said and did clean the data from the gateway.
All day until 1h ago i had left my arduino connected on my pc and i did like mfalkvidd said connecting the digital pin 2 to gnd and my arduino did not send any strange value to the gateway always seend volume 0.00 this was perfect.
Now that i'm at home i had connect my arduino to the sensor 3.3v gnd and digital pin2 and in the first log there it was value increase on volume when my sensor was in front off me...

I have a arduino nano pro 3.3v on easy pcb board and i'm using the hall sensor i dont see why i'm getting this problem...
I have a WiFi AP inside home and my sensor is outside.

Even the water flow says i have a 2.00 L/min when the sensor is not near the water meter.

New update.... have change the arduino mini pro for another one flash a new code a new sensor and again i'm getting volume data when the sensor is not near the water meter. I dont understand what's happening.

@mrc-core Just to make sure: are you connecting/disconnecting the data pin to your sensor when the Arduino is powered off and are you sure the connection is solid? If you connect things with power on you may accidently trigger a pulse a 100 times.... which will be sent to the gateway 20 secs later. Always power off stuff first and use a solid connection (soldering is always better) when making modifications. How did you power the hall sensor? Should be from the 3.3V VCC connector of the Arduino and not from the higher voltage or something separate. Can you upload a photo of your setup to allow us to see how you connect things?

@bart59 Yes i'm using the 3,3v from the arduino and i always connect everything with the arduino power off. Give me mor 5 minutes and i'll upload a photo from my sensor going to bring it inside home.@mfalkvidd i think i don't have anything magnetic on the place were i'm putting the arduino and the sensor at this time.

Ok here's the photo off my sensor. On my code i'm using the digital pin2 since digital pin3 has a resistor for Dallas and dht sensors but i'm not using them at this time. This arduino is only for water meter.

I think i have fix my problem. I have been playing with the code and the sensor and notice that the power led and data led on the sensor were always on no mater the digital pin i was trying to use.
This also happened with the analog pin A0.
In one last attempt i decided to use the digital pin 3 with the resistor soldered on the board for sensors like dallas and dht11 or dht22.

Now the first thing i had noticed was the data led was not on and now it only comes on when i passe a magnet under my sensor... it does not count any pulsecount if i passe the magnet over the sensor only under it.

Counted the times i had passed the magnet under the sensor and my gateway received te exact number 30 times = 0.030 volume and now the volume is stop at this number no more ghost encrease numbers.

Tomorrow morning i'm going to mount the sensor over the water meter to see if this finaly works.

The only problem i'm getting now is some NACK over the transmissions... like this:
6604747 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=3,st=OK:30
volume:0.030
604794 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=NACK:0.030
pulsecount:30
634781 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=1,st=NACK:30
volume:0.030
634828 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=2,st=NACK:0.030

@bart59 and @mfalkvidd Thanks for all the help. Today i toke the sensor to the water meter and for my luck my water meter is too old 1997 and no mater the position i put the hall sensor it just doesn't get any pulse at all at this time i really don't now what to use to get the data from my water meter...
I have already tried also the TCRT5000 and also does not work. Here's an image from my water meter

The TCRT5000 when i put over the glass the green led stays always on but when i remove it from the glass and point it to the black part of my meter the green led goes off the sensor is working ok but the glass from my meter does not help at all.

@mrc-core You are right. This is the wrong type of water meter. I have been using 2 other brands watermeters: the Honeywell C7195x2001B (see http://ecc.emea.honeywell.com/downloads/EN2R9029.PDF) and the Caleffi series 316 (http://www.arbo.it/images/techsheets/316405.pdf). You local central heating installation guy may have them as they are used in boiler systems of central heating for the warm water supply. They are also sold on eBay. Both work more or less the same and can be operated on 5V. The number of pulses per liter are much higher (something like 500 pulses per liter), so they are more accurate. You will need to modify your code to work with this. Below the code of my sensor (which also measures multiple temperatures at the same Arduino chip):

@mrc-core If I do a search for "B93 315.04 lisboa" I get MSV Janz company turn up, but I don't understand Portugese. It is probably a magnetic drive even at 1997 fabrication, but perhaps some searching will yield clues or contact the manufacturer?

You can see 5 water meters on that link all off them say's Magnetic Transmission "Transmissão magnética" but has you can see none off them look like mine. Has i can understand mine is the more basic off them all i do belive that i have the first generation off this water meters.

I have done one last test yesterday leaving a water tap open and passed the hall sensor all over the water meter from side to side and top to bottom and never got any impulse digital led light turning on.
The led did turned on when i put my finger in the top off the sensor or in cables near the pins of the sensor.

@mrc-core Well, I did suggest contacting the manufacturer with the information on your meter, they are better able to advise or may even sell a sensor head to retrofit. Usually these manufacturers are very helpful, and at least you speak the language.
I know that some manufacturers insist on factory building the sensor arrangement inside the meter (Zenner?) but you may be lucky.
The magnetic drive is more to avoid mechanical connection between the metering section and the water flow, so no axle or sealing ring to leak !
I have a plastic Elster, it has the same magnetic coupling as yours, but I was unable to sense any changing magnetic field when I checked it, but I had already ordered the specific read head for it so was not unduly concerned, and it should arrive in next few days. This sensor pulses when a small metal arc on the small dial passes beneath the sensor every 1 litre. It was around 30 euro from memory, so not a mad price.

Hello,
i have got water meter with pulse output. So I have just arduino and RFM69W. Sleep mode false/true works well with standard bootloader. Optiboot with sleep mode false works also well. But I would like to run it on battery optiboot with true sleep mode which doens work correctly. Sensor doesnt receiceve last pulse count from gw.
Any idea how to fix it?

When its about 2 metres far from gateway its received. Afterthat can be moved 10 metres away and it works. But after reset has to be moved close to gateway again.
I run also power meter pulse sensor. This has got different issue. It falls asleep before receiving pulse count from gw.

@ladislav Sounds like a radio problem. Are you using a capacitor on the radio power supply pins? A capacitor on all radios in your network. I have a an Ethernet gateway in our basement and a node in our attic that is two floors above it and it works fine using a NRF24 for all radios and the radio power is on the default setting and it communicates fine.

@smilvert I am afraid your water meter does not work. On many other watermeters the black spinning wheel is somewhat bigger and has a small mirror attached. The light from the IR LED is reflected by the mirror and the IR sensor picks up the reflection as a pulse every rotation (in your case 0.5 L). I suggest you buy another water meter that has a sensor build in and provides you with a direct signal. In my home I have separate water meters for each water consumer (such shower, hot water, kitchen, etc.).

I am using a Honeywell C7195A2001B which has a hall sensor that pulses at 7 Hz per liter/min, so you will get 420 pulses per liter. These meters are typically used in boiler or central heating systems that also can provide hot water for your shower. You need to modify the source code a bit to handle the high pulse frequency, but the nice thing is that the measurement is very accurate.

@smilvert You could try a magnometer. I successfully used one on my gas meter that didn't have a magnet in it. Look up "gas meter using a magnometer" in this forum. The code is much different than using the standard water meter sketch.

@smilvert@dpcr
I really doubt this type of water meter having a magnet to sense. Gas meters often are prepared to use a special reed swich to be mounted somewhere outside on the enclosure, and the magnet comes pretty close to the enclosure to be sensed.

I somewhere found a different solution approach using a modified TCRT5000 board with green LED and a specific lightsensor (see here for details, german).

The idea behind it is to use complementary (green) light to one of the red pointer wheels to improve contrast when the small pointer passes.

I recently did some first test wrt. to this, but different to the mentioned solution, I used the original LED/sensor places to connect these two parts (and also changed the resistors values). Unfortunately, I wasn't able to test it "at the right place" until now. As far as I can see, the TCRT5000 inside just also consist of two seperate parts inside a housing. So you may try to do it like that: just pull of the plastic housing, change the LED (see TCRT datasheet which one) with a green one, focus LED and sensor a little more than normal and see, if you get reasonable results whith the trimming resistor.

@rejoe2 A magnetometer doesn't need a magnet to work, my gas meter doesn't have a magnet and it works fine. Most all smartphones have magnetometers in them to sense direction. However your solution looks to work as well and probably with less code.

@smilvert
I also have same meter as the picture. Yesterday I installed my sensor
I took a TCRT5000 IR sensor, https://www.mysensors.org/store/water
A cap from a soda bottle, cut it so it fits above left red wheel(X0,0001) which means one lap i 1 liter
It works but it counts little bit wrong, I have change the

if (interval<500000L)

to

if (interval<2500000L)

but anyway it counts about 3 times to much. I will check it later today

@flopp
This didn't worked so well, I got a lot of errors everytime nRF was sending data, then I got one pulse.
Anyone know how to protect the digital input to NOT fall when nRF sends?
Wait, when I was writing this text I just remember that nRF is using Pin 2, is that correct?
I will try to use pin 3 instead, as interrupt pin

You don't use a green led? I tried that and it seems to work better but then I struggle with the mounting.

I am using IR to detect movements. Green LED is flashing eveytime the IR detects movement and Red LED is power for PCB.
I am using Digital Output from PCB to pin 2 or 3 on my UNO. I have tried both with INPUT_PULLUP and without, also tried 20K between Digital Output and GND. nothing is helping

That is nice! But I would have to test it out! Probably that would make the node all the time awake during a long bath! Ok, it would not use the radio all the time, but I would like to know who that would affect the battery!

@flopp Did you ever manage to stabilize the readings? Am I understanding you correctly that the readings were fine but the transmission got the reading scrambled?

Did you try to find a magnetic field with the meter instead? I have a similar meter and I'm wondering how best to approach the problem. I've seen people hook up Raspberries and cameras to do OCR basically but that seems like way too complex for an easy problem.

@bjornhallberg Suggest you discuss with your water supplier, and see what THEY intend to deploy for comms and explain what your own objectives are, that may refine what you are looking at, and they MIGHT actually help rather than be play "stupid" which is unfortunately common nowadays. In all probability they will be looking at wireless m-bus for drive-by readings, this is the predominant method of retrieval.
I admit to surprise at them deploying ultrasonics, they are on the expensive end of the market but they are extremely reliable and accurate.

@bjacobse Another option perhaps to consider (if it is physically viable), is to insert a meter and sensor of your choice within your property, they are not expensive nowadays and easy enough to fit ?
A simple meter and reed switch such as this link text or similar perhaps.

@zboblamont
In Sweden you need a certified installer to exchange your pipes, else in case of water damage your insurance won't cover.
so cheapest for me is a RPI with camera - but yes I would prefer a "real" measuring from a dedicated sensor

@bjacobse Pardon my laughter, insurers look for any excuse for sure, but I have never heard yet where a water meter or any other competent insertion damaged a building, let alone an insurance company refused to compensate for a building which burned to the ground (99.9%) on the basis the water meter was not a verified install. For sure some loss adjusters will use any excuse, but really?
To clarify, in many countries a certified inspector or Engineer must certify that work is carried out within the regulations, it does not state that HE/SHE has carried out the work, only that it has been inspected and verified as compliant. You know any certified local plumbers with 5 minutes to spare, because that is how long it takes me to fit one, and about the time it takes a certified pipe-jockey to verify it's right and sign it off, if it really concerns you ?

I have 2 self fitted water meters with sensors, gas meter sensor etc, and a huge amount of DIY stuff any smartass insurer could IMPLY was a contributory factor to the disaster which befell my house, but frankly it wouldn't stand 1 second in Court before being laughed out...
Place hasn't burned down yet, fallen over in earthquakes, or been subjected to landslide, but luckily I don't have Swedish Insurers....
PS- I should clarify that the standing regulations are framed to quite rightly protect consumers as well as the service provider against cowboys interfering with apparatus. Changing light switches or sockets falls under the same overall umbrella despite everyone and their mother changing them.

@bjacobse I believe you can replace the meter yourself if you own it yourself and have the necessary skills. I live in such an area and was told I could mount it myself if I was confident enough. But of course, the fault will be yours if your bad job causes damages. In reality it is quite unlikely that you can mount it badly and not notice the problem immediately.

A more critical issue is that water meters are usually owned by the municipality or water company and they are sealed. It is impossible to replace the meter without breaking the seal and when the company notices they won't be happy at all.

@fredswed And by extension (Possibly Swedish water suppliers differ from UK or Romanian counterparts?) the data retrieved from their devices is often regarded as their property also, and brick walls begin to appear ino what should be readily shared data. If they will not share, fitting a downstream device within your own control can often be the only solution, don't interfere, augment...

As a perverse example, my own gas and electricity suppliers are the German monolith EON who provide and enable access to their 'graphs' online, updated with 1 or 2 month readings (gas and electricity).
Having checked the base data for their graphs, I realised they were presenting a lovely graph based on complete bunkum, and developed and maintained my own ever since, which IS accurate. I checked recently and their graphs are still pretty but complete rubbish.
Installing a gas meter sensor caused EON palpitations until they realised it was the commercial device for the meter and could not object on technicalities then quietly dropped objections, I don't care how they respond when I fit meters to the Consumer box, it is nowhere near their SMART meter which tells me nothing but tells them much, mainly that I halved their 2 monthly bill .
If the service provider will allow detailed sharing of YOUR data, all good and well as it is mutually beneficial, but if not, easy enough to solve at your own expense.
I fitted two replacement upgraded radiators in the last month, somewhere a Romanian regulation lurks that I should not have done so, but the insurer doesn't give a damn unless it is found to have caused the demise of the insured property.. Is it worth the risk? Hell yes...

It looks very interesting. I complied and uploaded successful, but it ran without run the loop function at all. infrared sensor lighted up but no print out attached Serial.print.
Can you give us the url to the library #include <MySensors.h>?. I am using MySensors 2.3.1 loaded from Adruino IDE->Tools->Manage Libary->search My Sensors from https://www.mysensors.org

Sorry to hijack the thread a bit,
I'm using a TCRT5000 sensor to read a water meter (Zenner), it works ok until it stops detecting pulses, I have to increase the sensitivity (clockwise turn the trimpot) and it works ok for another few days/weeks, then again it needs an increase in sensitivity, like somehow it's loosing it's sensitivity .
I'm already with my second sensor, the first one got to the end of the trimpot and couldn't adjust anymore.

Has this happened to anyone else? It's powered by 5V, it's the LED losing power or the photosensor losing sensitivity? Any ideas?
Thanks.

@flopp which box did you buy for m-bus readings? did you work it out?
''I was so lucky that my water company change the meter to a meter with wireless m-bus.
So I bought a box for this and now I have 100% correct readings.''

Water Meter shows up in mysensors.json and homeassistant logs but fails to appear in Homeassistant GUI.
I have a dozen Nodes already successfully operating
I used the default sketch on this page. Just added Node 6
Looks like values are not getting through
Thank you for your help

Crying out loud most likely will not help...
Seems your setup is a little special, so just some assumptions from one using a serial GW and not MyS-MQTT:
Your controller is asked for sending an initial value, but has none yet. So no answer is sent out. Triggering the counter on Node side could help to send one (after waiting time has passed). Then have a look at your controller, if there's a value available. If, you might set the correct value, restart your node afterwards and see, if everything now works as expected?

Logparser states: there was nothing counted (empty payload). So make sure, there really was counted anything.
(I didn't check your sketch, just assuming, it's the default one and everything is wired correctly; if that's the case, you should be able to see a different payload than nothing or "0", that your controller might treat as non existent).