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.