Export sensor data to text file

You can use the file notification for this.
All you have to do is build the message like you want.
eg:

notify:
  - platform: file
    name: filenotify
    filename: /your/path/to/file.csv
    #timestamp: true

automation:
  - alias: sensor_values_to_file
    initial_state: 'on'
    trigger:
      - platform: time
        at: '23:59:55'
    action:
      - service: notify.filenotify
        data_template: 
          message: "{{ states.sensor.test_sensor1.state }};{{ states.sensor.test_sensor2.state }}"

Not tested, just play with it. :slightly_smiling_face:

17 Likes