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!)
Hi,
I am trying to replicate the same setup a I have the same need but it fails (running current current version of HA).
When I run the automation, the traces feature from automation indicates that the action is not found
Error: Action notify.shellyenergyconsumption not found
Here is its decl in configuration.yaml:
notify:
I have added the directory : /config/tools/ShellyEnergyConsumption/ to the list of authorised directories:
homeassistant:
allowlist_external_dirs:
- ‘/config/tools/ShellyEnergyConsumption/’
in dev-tools/states I can read that the id : notify.shellyenergyconsumption exists in an unknown state.
Could you confirm that your setup still run today ?
Thx in advance for your advice.
As long as nothing is written to the file, the state will be ‘unknown’. As soon as something is written, the state changes to the last written timestamp.
Maybe show the automation that writes to the file.
file notifications are not configured in configuration.yaml any more.
My notification is like this:
notify:
- platform: file
name: shellyenergyconsumption
filename: /config/tools/ShellyEnergyConsumption/data.csv
timestamp: false
Where should I declare my notification, if not in configuration.yaml ?? I read the linked doc but did not find where to put it.
My automation looks like this:
- id: '192837465'
alias: Save Shelly Meters Total per Day
triggers:
- at: '23:55'
trigger: time
action:
service: notify.shellyenergyconsumption
data:
message: "{{ now().strftime('%d/%m/%Y') }}"
I will have a look at google sheet integration to check if it can help.
Thx