setterlee
(Marco Nuñez)
April 28, 2018, 12:30am
1
Hi to all.
I Have a xiaomi gateway and a sensor temperature working with my HA configuration.
I want to save the sensor state in a log file, I tried with a Shell Command and a Automation but the Shell Command won’t work.
Here my Shell Command:
temp2log: 'echo {{ states.sensor.temperature_158d0001a2c25c.state }} >> /home/setterlee/logs/temperature.log'
Any idea?
thanks
setterlee
(Marco Nuñez)
April 28, 2018, 12:36am
2
Well,
I found the solution with this workaround:
temp2log: /bin/bash -c "echo '{{ states.sensor.temperature_158d0001a2c25c.state }}' >> /home/setterlee/logs/temperature.log"
dmo147
(dmo147)
January 13, 2020, 9:11pm
3
This is neat. I’m looking for something that can collect historical temperature over a period of about one month. Any suggestion on how I can accomplish this will be appreciated.