which outputed the below
Home Assistant notifications (Log started: 2019-03-27T13:25:35.741025+00:00)
--------------------------------------------------------------------------------
KmtyOWV-Wus
is there anyway to just have the sensor state and nothing else?
Hi,
First try to help in the community so lets see if i can
I am using notify.file to get a sensor state.
Now i have made an rather ugly solution maybe, to empty the file from the extra added rows.
I use a bash script to “clean” the file. And after the data is used i empty it.
For me it is used to create another script for sending notifications to a lametric clock, there for it has to be specific for the next script to work.
Here is my solution:
I use this in a bash-script execution:
# Write Count of SumpPumpRuns per Day
- alias: Write SumpPumpCount per Day
trigger:
platform: time
at: '23:59:45'
action:
service: notify.sumppumplog
data_template:
message: >
{{ now().strftime('%d/%m/%Y') }}, {{ states.sensor.sumppump_runtime_count.state }}
After the first run I manually edited the header so that I can read the csv properly as a table; the sutomation only adds info at the bottom and leave the previous entrie s unchanged.
I know it’s been a while since your post but just wanted to thank you for your solution re. the notify-file component. This is just what I needed.
As a side note to Synology users I believe that you have to stop/start the Home Assistant for it to reload the configuration file (took me a while to figure out!)