Creating an own Log History Viewer - Question

As another option based on your original question, you could use the File Notification component and an automation to send events to that file. E.g.:

notify:
  - platform: file
    name: mylog
    filename: mylog.txt
    timestamp: True

automation:
  - alias: Write events of interest to mylog
    trigger:
      platform: state
      entity_id:
        - sensor.SENSOR1
        - light.LIGHT1
    action:
      service: notify.mylog
      data_template:
        message: >
          {{ trigger.to_state.name }} changed to {{ trigger.to_state.state }}

You can list as many entity_id’s as you like. And, of course, you can make the message more appropriate for each type of entity/event with additional templating.

4 Likes