Is it possible to write & read text file

Hi
is it possible to read and write file through HA.
so automation can me made little easy like schedule multiple device write to some file and then read from file.
any suggestion will be helpful.

1 Like

I don’t know of anything like a text file component, but you could use a command_line sensor to read a file, and a shell_command to write. Use templating to process what to read and write.

yes you can using a custom component at least this is possible.

CON_CONTEXT_PATH = '/config/custom_components/your_service/'
    with open(CON_CONTEXT_PATH + "file.txt", "a") as file:
                file.write("\n"+message + "\n"+response_text) #output to file