Way to track automation history (automation read/write to a file)?

Hi,

I’m doing a little automation script that is sending IR commands via Broadlink RM Mini 3 to a AC - it will decrease the temp in the morning and increase it on some events or in the evening (whatever comes first). But here is a possible scenario:

  1. In the morning the AC temp is decreased.
  2. It should be increased at 6 p.m. but at this time there is a power outage and electricity is restored at 6.15 p.m. then the HA won’t send the command for heating.
    I’m thinking about:
  3. When a command is sent (increase, decrease) it will write the desired temp in a text file and overwrite it each time.
  4. There should be an automation running every 15/30 mins checking that file content. And even if there is a power outage at 6.00 p.m., when it runs at 6.30 p.m. - it will notice that a) it is after 6 p.m. b) the temp is 19 C, not 24C and will send increase command.
    What is the easiest way to achieve that?
    Or even better - if I can access automation log from somewhere - this is an option too.

Thanks! :slight_smile:

For key automations like that, consider adding a startup trigger, and put the time window in the conditions.

Then you’ve got an automation that at 18:00 will set the temperature to 24C, and if it’s restarted and starts after 18:00 but before (say) 21:00 it’ll set the temperature to 24C.

Yeah this is good workaround - will do it. Although, I’m still curious is there is an option to read/write text file for similar functionality.

You could possibly abuse notify file and the file sensor that way.

1 Like

A post was split to a new topic: How to use notify.file