P1 watermeter device missing

Moderator: leecollings

Maartenc
Posts: 6
Joined: Wednesday 16 September 2015 22:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

P1 watermeter device missing

Post by Maartenc »

I've created the P1 hardware in domoticz, and I can see domoitcz created devices for the elektricity and gas meters.
But there's no device for the water meter. I can see in the data that the information for the water meter is available (24.2.1):

Code: Select all

/FLU5\253769484_A

0-0:96.1.4(50216)
0-0:96.1.1(3153414733313030353733313933)
0-0:1.0.0(220812104627S)
1-0:1.8.1(000012.755*kWh)
1-0:1.8.2(000005.763*kWh)
1-0:2.8.1(000000.159*kWh)
1-0:2.8.2(000000.000*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(00.123*kW)
1-0:2.7.0(00.000*kW)
1-0:21.7.0(00.009*kW)
1-0:41.7.0(00.006*kW)
1-0:61.7.0(00.107*kW)
1-0:22.7.0(00.000*kW)
1-0:42.7.0(00.000*kW)
1-0:62.7.0(00.000*kW)
1-0:32.7.0(229.1*V)
1-0:52.7.0(231.5*V)
1-0:72.7.0(233.1*V)
1-0:31.7.0(000.09*A)
1-0:51.7.0(000.03*A)
1-0:71.7.0(000.82*A)
0-0:96.3.10(1)
0-0:17.0.0(999.9*kW)
1-0:31.4.0(999*A)
0-0:96.13.0()
0-1:24.1.0(003)
0-1:96.1.1(37464C4F32313232303935333931)
0-1:24.4.0(1)
0-1:24.2.3(220812104535S)(00001.326*m3)
0-2:24.1.0(007)
0-2:96.1.1(3853455430303030323731323938)
0-2:24.2.1(220812104503S)(00000.302*m3)
!25FD
How can I get the watermeter information in domoticz?

thanks
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: P1 watermeter device missing

Post by FireWizard »

Hello @Maartenc,

You asked:
How can I get the watermeter information in domoticz?
You can't, as it is currently not supported by Domoticz

See, https://github.com/domoticz/domoticz/bl ... erBase.cpp

What you can try (but I never tested it with the output of the Smartmeter) is to "pipe" the result of your command (used in your example) into mosquitto_pub. In that case you can read the result by any MQTT client and it can be read by Node-Red as well.
With Node-Red you can push it either by MQTT or HTTP to Domoticz. You should have a MQTT broker installed.

Regards
Last edited by FireWizard on Thursday 25 January 2024 23:12, edited 1 time in total.
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 watermeter device missing

Post by waltervl »

You could also parse the telegram with DzVents and put the values in a dummy Watermeter device.
See for example topic
viewtopic.php?p=255949
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
Eddiever
Posts: 105
Joined: Thursday 27 April 2017 20:32
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands (Hoogeveen)
Contact:

Re: P1 watermeter device missing

Post by Eddiever »

To my knowledge the watermeter isn't connected to the smart meter. There are possibilities as shown in this topic:
viewtopic.php?p=275426&hilit=watermeter#p275426
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 watermeter device missing

Post by waltervl »

Eddiever wrote: Friday 12 August 2022 13:25 To my knowledge the watermeter isn't connected to the smart meter. There are possibilities as shown in this topic:
viewtopic.php?p=275426&hilit=watermeter#p275426
In this case it looks like it is:
Gasmeter
0-1:24.1.0(003)
0-1:96.1.1(37464C4F32313232303935333931)
0-1:24.4.0(1)
0-1:24.2.3(220812104535S)(00001.326*m3)
Watermeter
0-2:24.1.0(007)
0-2:96.1.1(3853455430303030323731323938)
0-2:24.2.1(220812104503S)(00000.302*m3)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: P1 watermeter device missing

Post by FireWizard »

As you might have seen in the presented telegram this P1 meter is a Belgian (Fluvius?) meter.
Indeed in The Netherlands I'm unaware of a smart connection between electricity meter and watermeter, but it is incorporated in the latest versions of the smartmeter protocol.

So, why not support it?

Regards
Maartenc
Posts: 6
Joined: Wednesday 16 September 2015 22:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 watermeter device missing

Post by Maartenc »

Thanks for the answers.

The watermeter is deffinitely connected to the smart meter.
I'm now writing a python script to read the watermeter value every 5 minutes and push it to a dummy device.

Do you know which dummy device I should use? I'm not pushing the usage of the last 5 minutes, but the total meter value. Most counters seem to expect the usage of the last period as input.

Hopefuly they 'll support it out-of-the box in the future. It's indeed a meter from Fluvius.
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 watermeter device missing

Post by waltervl »

You can /have to use the the device Counter and set it to type Water
https://www.domoticz.com/wiki/Dummy_for ... es#Counter

Be sure that you send liters to the counter (it now shows m3 in the telegram eg 00000.302) So you have to send an integer 1000*telegram value.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Maartenc
Posts: 6
Joined: Wednesday 16 September 2015 22:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 watermeter device missing

Post by Maartenc »

Thanks, everything works now :)
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 watermeter device missing

Post by waltervl »

Great!
Can you share your python script for future reference?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
Eddiever
Posts: 105
Joined: Thursday 27 April 2017 20:32
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands (Hoogeveen)
Contact:

Re: P1 watermeter device missing

Post by Eddiever »

Oh wow, wish my watermeter was also connected to my smart meter. Didn't know this.
Maartenc
Posts: 6
Joined: Wednesday 16 September 2015 22:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 watermeter device missing

Post by Maartenc »

maybe there are better ways, but this is how it works for me (quick and dirty).

Every 5 minutes I launch a "cat" command to capture data from the P1 port and send it to a file. With a python script I read the input of the file and send the value to domoticz.

When the capture is running, domoticz is not receiving any data from the P1 port, so I kill the capture after 1.5 seconds. Domoticz looses 1 data packet every 5 minutes.

/etc/crontab:

Code: Select all

*/5    * * * *    root    /bin/cat /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB6ZXQY3-if00-port0 > /opt/script/meterstanden/serial
*/5    * * * *    root    /opt/script/meterstanden.py >> /opt/script/meterstanden/log 2>&1;  /usr/bin/killall cat
First line is to capture data from the P1 port and send it to a file.
Second line launches at the same time. The python script sleeps for 1.5 seconds, by that time there's new data in the file to process.

meterstanden.py:

Code: Select all

#!/usr/bin/python
import time
import datetime
from config import *
time.sleep(1.5)

read = True
elektrDag = 0
elektrNacht = 0
gas = 0
water = 0
counter = 0
with open('/opt/script/meterstanden/serial') as f:

    while read:
        counter = counter + 1
        line = f.readline()
        line = line.strip()

        if line.find('1-0:1.8.1') > -1:
            start = line.index("(") + 1
            end = line.index("*")
            elektrDag = float(line[start:end])

        if line.find('1-0:1.8.2') > -1:
            start = line.index("(") + 1
            end = line.index("*")
            elektrNacht = float(line[start:end])

        if line.find('0-1:24.2.3') > -1:
            start = line.index("(", 12) + 1
            end = line.index("*")
            gas = float(line[start:end])

        if line.find('0-2:24.2.1(') > -1:
            start = line.index("(", 12) + 1
            end = line.index("*")
            water = float(line[start:end])

        if line == '!FAF0':
            read = False

        if counter > 50:
            read = False

print("{}:dag:{}:nacht:{}:gas:{}:water:{}".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), elektrDag, elektrNacht, gas, water))

domoticzRequest('http://localhost/json.htm?type=command&param=udevice&idx=225&nvalue=0&svalue=' + str(water * 1000))
This script logs all current meter values for electricity (day/night), water and gas and sends the current water data to domoticz.

this is a relevant part of the config file:

Code: Select all

def domoticzRequest(url):
  base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
  request = urllib2.Request(url)
  request.add_header('Authorization', 'Basic %s' % base64string)
  response = urllib2.urlopen(request)
  return response.read()
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: P1 watermeter device missing

Post by willemd »

Eddiever wrote: Friday 12 August 2022 14:57 Oh wow, wish my watermeter was also connected to my smart meter. Didn't know this.
The easiest way probably is to get a Homewizard WIFI watermeter and then poll the API page to get the data into Domoticz.
I am doing the same for the P1 values and the kWh production of my solar panels.
Daviddm
Posts: 2
Joined: Tuesday 19 January 2016 14:16
Target OS: -
Domoticz version:
Contact:

Re: P1 watermeter device missing

Post by Daviddm »

Hi all,

I'm living in Belgium and they installed digital meter for Electricity/Gas and also for Water. The digital water meter communicate with my Digital electricity meter. Normaly i should get info via P1 cable. It doesn't work for the moment. What is the best solution right now to get it?
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: P1 watermeter device missing

Post by FireWizard »

Hi @Daviddm,

As said in a previous post in this thread, it is currently not supported.
As far as I know, it is not used in The Netherlands.

Perhaps Node-RED can handle it, if you are able to read the RAW data.

Regards
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: P1 watermeter device missing

Post by gizmocuz »

Best to add this to the P1 hardware in Domoticz... I will have an attempt
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: P1 watermeter device missing

Post by gizmocuz »

Are you sure you don't have the gas and watermeter swapped? I don't have a watermeter, but this is my gas

0-1:24.2.1(221028153510S)(04474.480*m3)

0-1:24.2.1

not

0-1:24.2.3

as in the scripts above... maybe someone can verify this as well ?
Quality outlives Quantity!
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: P1 watermeter device missing

Post by FireWizard »

Hello @gizmocuz,

I agree with you that the best way is, to add this to the P1 meter hardware.

But if you do, I suggest you look also to the Scandinavian P1 specification and also the use of this protocol in heat pumps, etc.
In the last 2-3 years I have seen several questions on this forum of users, who want to interface other implementations.

You asked,
Are you sure you don't have the gas and watermeter swapped? I don't have a watermeter, but this is my gas
I think he is sure. Remember this is a Belgian Fluvius meter and not a standard Dutch one.
And as you might know, a few things are different in Belgium :D

Dependent on the used M-bus channel, we use 0-n:24.2.1, where n might be 1, 2, 3 or 4.

In Belgium, however, they use 0-n:24.2.3, where n is 1, 2, 3 or 4.

That is one of the differences in the protocol (there are more)
Read Note 2 on page 12 of Emucs specification version 1.6

All these things are described in the Emucs specification, which, as far as I know, has currently evolved to version 1.7.1.
You can also look in version 1.6, where the recent changes regarding the water meter are highlighted.

Both versions you can find at: https://github.com/FireWizard52/P1-Smart-meter
Have a look to the last pages with examples of the protocol.

Best regards
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: P1 watermeter device missing

Post by gizmocuz »

It seems there is a identifier

Gas: (3)
0-1:24.1.0(003)

Water: (7)
0-2:24.1.0(007)

made a patch and a new beta is building (14584), could take 30 minutes
Quality outlives Quantity!
Daviddm
Posts: 2
Joined: Tuesday 19 January 2016 14:16
Target OS: -
Domoticz version:
Contact:

Re: P1 watermeter device missing

Post by Daviddm »

The patch did it! I can see my water meter now, thx!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests