Hi everyone. I´m unfortunately a bloody beginner with Home Assistant. I have created some easy automations but I have one use case which seems not so easy (for me).
I do have an energy meter (Shelly). It has two sensor values: Energy [kwh] and Power [W].
I want to track the energy consumption every 15 mins. That means: The amount of used kwh of the last 15 mins, shall be written to a CSV file with date and time stamp. (Finally there shall be a couple of energy meters and their data shall end up ideally in the same CSV file at the same time (data must be from the same 15mins. window!).
[Background is selling energy of a photovoltaic to tenants]
I would appreciate your help and some explanation why this or that is needed. Would like to understand what I´m actually doing and learn for future use cases.
Create a ‘Utility Meter’ Helper from the Energy Sensor that resets every 15min and use the notify.send_message action to dump it into a csv file on you HA machine.
For the trigger I’d probably use a template trigger (second option below) instead of a time pattern one (first option) to make sure it dumps the values before the reset every 15min:
Hi, I finally found a video explaining basically what I needed. It ended up pretty much in your solution.
However, I have one issue remaining. I have created the utility meter sensor and the reset every 15 minutes. And my automation runs every 15 minutes. As a result, the value written to the file is always 0.
How can I get the value just before the helper is reset? Or is there a possibility to include the rest of the helper in the automation?
And: How to change the reset interval of an existing Helper. Seems I´m blind but I can´t find it anywhere in the settings.
I guess, using a template trigger as described above instead of the time pattern trigger is necessary after all.
You probably just need to play with how many seconds before the full 15min you need to dump the values into the CSV to avoid the issue of getting 0 values.
Hey everyone. I found a way now by using a consumption value sensor. Through an automation I was able to write the data into a csv file + reset the sensor to 0, so it starts to count again. Great.
Now I was comparing my values from the CSV file for one day to the consumption values of my shelly energy meter and it does not match 100%. About 5% difference.
Any idea how this can happen?
Just to conclude this. Finally I decided to just take the consumption values of the “physical sensor” directly and write it into CSV. The “delta” calculation I´m doing in a simple Excel template after download.