I get my water consumption reported once a day at the same time. I’ve been playing around with total and tota_increase. However, the values are correct one day and then no longer the other day.
How exactly do I have setup the sensor?
If the sensor provides the consupmtion of the day, then you should add those up to get the overall consumption. I would add a template sensor for the day, test with an if-clause, whether the value has changed and then add the day to the sum. Perhaps someone has a smarter way but this should work.
Do you have a link or example for me for the day sensor?
The values are supplied from a REST call. Can I also build a sensor that always resets the last reset with now()? Is something like this possible?
total + lastReset now() should be enough, right?
Ixm not sur if there is a possibility with a property as drafted by you. But you could use a helper where you store the time the sensor last has been updated.
It must somehow be possible to simply display the daily water consumption on the dashboard if the value is delivered once a day (via REST) or after a restart.
@MelleD
Do you get the water consumption value in any way into the HA instance? In developer/template editor or states? If not, you might not have the time values included in your URL.
I played around with it and found a solution to get the value into HA.
The only thing is, that two different API calls are needed to get all values from the BWT Perla system, and running them at the same time only delivers one or the other, but not both. But you already have mentioned this in your thread here in the forum.
My current configuration for the water consumption value in file: configuration.yaml
Yes i know but this is not enough for the energy dashboard. There you get then wrong numbers some days. The sensor have always the same values, but not the UI on the dashboard /waterconsumption?since={{ (now() - timedelta(days = 1)).strftime("%Y-%m-%d") }}
Actually it’s pretty easy. With total_increasing and querying the water values every 30 minutes, it works quite well. However, as soon as the REST endpoint is requested more often, e.g. due to a restart etc., the value is added too often. How can this be prevented?
I can query my water consumption every 30 minutes and I have no idea how to build a suitable total increasing sensor
I have the following two problems:
The REST endpoint can be queried more often after a restart, which means that the values are falsified the total increasing sensor.
Idea is:
I would probably need a sensor or helper, which has saved the last status. What is best for this?
How can I only update the total_increasing sensor if this value has really changed?
Is it easy to build a python script directly for this?