Is there anyone who knows how to make
water template sensor with m3 into liters calculation?
1m3 is 1000l
sensor:
- platform: template
sensors:
value_in_l:
friendly_name: "Value in Litres" # Or whatever you want to call it
unit_of_measurement: "L"
value_template: "{{ ( states('sensor.your_m3_sensor_here') | float / 1000 ) | round(3) }}"
Y’know google will tell how to convert units. Metric is pretty easy.
Ha. Oh dear.
states('sensor.your_m3_sensor_here') | float * 1000
Ok here is the thing i get this readout
3,942.4597m3 from the begining. I am trying to figure out how to convert
This numbers into liters
Examble:3.942.459 the last number 7 is 10th of liter.
So that i can get this readout per 24 hours
Examble 2.4 tons of water or
Exeamble 2.400 liters
As per the eventual outcome of the posts above, you need to multiply your m³ sensor by 1000 to get litres. See @tom_l’s first post, but use float * 1000
rather than float / 1000
.
Your daily figure is a new requirement: try the Utility Meter for that. If you want tonnes, you could stay in m³, as 1m³ of water weighs 1 tonne.
oh i forgot to mention i am reading from mqtt are there other values for that?
Yes. Share your sensor configuration. Correctly formatted.
platform: mqtt
name: Water Meter
state_topic: "watermeter/reading"
unit_of_measurement: m³
icon: mdi:water
unique_id: WaterMeter
I am getting info from my hotwater counter with this software
Done with formating
Hope it was right
platform: mqtt
name: Water Meter
state_topic: "watermeter/reading"
value_template: “{{ value | float * 1000 }}”
unit_of_measurement: L
icon: mdi:water
unique_id: WaterMeter
Thanks alot for your help.
Is it difficult to make template sensor witch calculate cost per day or by month and week
There are sensors for that built into home assistant. https://www.home-assistant.io/integrations/utility_meter/
but in the gui you can’t adjust liters or m3 or something.
Dunno why you are still troubled by this getting on for 2 years later. The template is the solution.
Yes. Left, at the bottom, click your name, there you can remove the stupid , or . completely and replace it with a space. And other formats. Why this is not under Settings (at least I could not find it). Settings needs A WAY better interface like Apple settings that actually show where you are. I get so lost in Home Assistant settings I have to use Google Maps to find my way…