Hello, can anyone help me? I need an automation that saves my sensor "sensor.tasmota_mt681_total_in_kwh" (REFERENCE) and my sensor "sensor.tasmota_mt681_total_out_kwh" (FEED) to a stromverbrauch.csv file every day at 11:59 PM. It just doesn't want to work.
My code is:
alias: "Speicherung Energieverbrauchswerte"
trigger:
- platform: time
at: "23:59:00"
action:
- service: notify.notify
data:
- service: file.write
data:
path: "/config/www/excel/stromverbrauch.csv"
content: >
{{ now().strftime('%Y-%m-%d %H:%M:%S') }}, {{ states('sensor.tasmota_mt681_total_in_kwh') }}, {{ states('sensor.tasmota_mt681_total_out_kwh') }}
mode: single
´´´