Youless - monitoring water meter on S0 port

So I installed my Youless LS120 power monitor.
It’s connected to our smart meter throught the P1 port.
Gas & electricity are working as expected & plot very nice in the new energy dashboard.

Right next to the Smart meter is our water meter, it has a small hole where you can insert a reed contact. Although this input is designed for an extra KWH meter, I was under the impression I would be able to use this for the pulses of our water meter.
So I connected the reed contact to the S0 port on the Youless. Changed the “S0 imp/kWh” in the youless to “2000” since it pulses every 0,5 liter.
And I see this working in HA, when the water is running I see the usage increase.
The only problem is, it’s shown in Watt & KWH.
Is it possible to change these to Liter & M³?

Or would it be a nice feature to add the possibility to make this S0 input configurable?

I have the same, Jurgen.
Did you have a solution? Water isn’t energy but it’s definently something to keep track of.
Or did you get response to the feature request?

This is quite easy to “fix” yourself by creating template sensors. I’m assuming you have the entities sensor.extra_total and sensor.extra_usage from your Youless - if yours are named different replace the names below with what you’ve got.

Place the following in your templates.yaml file (assuming there’s a line “template: !include templates.yaml” in your configuration.yaml):

- sensor:
    - name: "Water totaal"
      available: "{{ is_number(states('sensor.extra_total')) }}"
      unique_id: sensor.water_totaal
      state_class: total_increasing
      device_class: water
      unit_of_measurement: m³
      icon: "mdi:water"
      state: "{{ states('sensor.extra_total') | float(0) }}"
    - name: "Water verbruik"
      unique_id: sensor.water_verbruik
      icon: "mdi:water"
      unit_of_measurement: l/min
      state: "{{ states('sensor.extra_usage') | float(0) / 60 }}"

Then check your configurations file for errors, and restart Home Assistant. You should then see the new enitties in the development tools. If you’re on version 2022.4 or higher you can opt to set the sensor.extra_total and sensor.extra_usage entities to hidden so they won’t appear on auto-generated dashboards anymore. Don’t disable them though, they are needed for the template.

If you want to keep dayly and monthly totals as well, put the following line in your config.yaml (if it is not already there):

utility_meter: !include utility_meters.yaml

And create a file utility_meters.yaml with the following content

water_dagelijks:
  source: sensor.water_totaal
  name: Water dagelijks
  cycle: daily
water_maandelijks:
  source: sensor.water_totaal
  name: Water maandelijks
  cycle: monthly

Do note that by default Home Assistant does not keep long term history by itself. The energy dashboard uses a special long term storage, but normal sensors do not. I use influxdb for that (and Grafana to display it). But that is another topic entirely, you can find lots of topics on that subject here as well.

1 Like

I totaly forgot I made this post. But I implemented it yesterday and your solutions works perfectly.
Thanks for the help. I hope other people can use it for the same purpose.

1 Like

what brand/ model of water meter (sensor) do you use? I would love to implement this as well!

If you have a water meter with a rotating mirror, you can use the youless itself. It has an optical sensor.
I am using this, but it needs a compatible water meter:

Thats an expensive one! Will cost me more money then the water I use in a whole year :open_mouth:

Depending on your water meter, you can also create a free version. I’m using the analog energy meter (led pulse) with the same effect (rotating mirror, generating a pulse).

Can share my setup & node red flows on request

I connected a watermeter from HomeWizzard, working fine

Hi @Edwin_D thanks for this, works like a charm!

Any idea how to get this info into the energy dash? it states:

Assuming you use a youless as I do, the sensors it produces are exposing the sensor as energy, not water. So I created two template sensors to convert the unit. The “Water totaal” is the one I use in the energy dashboard, the other is for current usage, that is for normal dashboards.

The state class is needed for the energy dashboard to interpret changes in the value. The below should go in your template.yaml:

- sensor:
    - name: "Water totaal"
      availability: "{{ is_number(states('sensor.extra_total')) }}" 
      unique_id: sensor.water_totaal
      state_class: total_increasing
      device_class: water
      unit_of_measurement: m³
      icon: "mdi:water"
      state: "{{ states('sensor.extra_total') | float(0) }}"
    - name: "Water verbruik"
      unique_id: sensor.water_verbruik
      icon: "mdi:water"
      unit_of_measurement: l/min
      state: "{{ states('sensor.extra_usage') | float(0) / 60 }}"
2 Likes

Yes that works! many thanks!

1 Like

Amazing work thanks for the write up I have finally everything setup on energy dashboard.
However I have an issue with the water meter integration in HA the extra_sensor doesnt show any change despite using water all day. anyone had the same issue ?

Is the youless app reporting anything for the S0 port? If it doesn’t then the problem is not the HA integration but a problem with the connection of the sensor device or with the detection of the water meter. What hardware do you have connected to the S0 port? Could be as simple as a loose wire.

Thanks for your quick reply. I have a digital water meter and I dont use the S0 port water is already reported via the p1 port of my electricity meter. is there a way to make it work or move the data to S0 port ?

The post above is for water meters connected to S0. Most likely what you show needs to be read using another interface on the youless. This should be implemented by the one who built the integration. If that doesn’t happen you can most likely also use a rest sensor to get at it, but for that we need to know how it is reported in the interface. I don’t have this at home, nor do I have the rest interface description.

@JustAnotherPU, What do you get as a response when you enter this in the url field of your browser (replace the ip address with that of your youless):
http://192.168.1.100/e

This is what I get, we can see that water is reported correctly “wtr”: 109.031

[{“tm”:1694633107,“net”: 7129.301,“pwr”: 721,“ts0”:1694611800,“cs0”: 0.000,“ps0”: 0,“p1”: 3151.411,“p2”: 3978.051,“n1”: 0.024,“n2”: 0.137,“gas”: 1089.715,“gts”:2309132125,“wtr”: 109.031,“wts”:2309132123}]

Should I contact the youless support or the HA integration is not managed by them and created by an other user ?