Based on the Home Assistant Core Integration File
, I created a custom version that reads and writes multi-line content.
Use case examples:
- Store and read data larger than 255 characters
- Load email HTML templates
- Store large AI/ChatGPT responses
- ... and much more!
Features:
- Use the
notify
service to write multi-line content to a local file. If a file already exists, its content will be erased and the new content will be stored - Use the
sensor
service to read multi-line content from a local file. The content is available in thecontent
attribute of the sensor.
Removed:
- State of the
sensor
no longer holds the content of the file. Shows 'Ok' (for now :) ). - No header is written to empty/new files
Notes:
- ⚠︎ I have not limited the size of the filesize for the
sensor
service. On a dev setup I successfully read the 10M (Studenten Net Twente FTP) file. The 1000M ended up in a crash-reboot loop from HA.
Waiting on HACS to be added. In the meantime, this repo can be added as custom repository
- Download the latest release of the File++ from this repository;
- In Home Assistant, create a folder
config/custom_components
; - Add the File++ files to the
custom_components
folder (you should end up it with aconfig/custom_components/file_plusplus
folder); - Restart Home Assistant;
- Add a File++ entity as an Integration in Home Assistant
(menu: settings -> devices & services -> add integration)
;
For updates, repeat step 1 to 4. Home Assistant will not delete any configuration.
Configuration is done the same as the Home Assistant Core Integration File