I want to read a whole file into a sensor like the File Integration https://www.home-assistant.io/integrations/file/ does it from the homeasssitant file system. My issue with the File integration is that it only reads the last line into the sensor. But my file I want to read is human readable formatted JSON file so its got a few line breaks. I really haven't found any answer to this pretty simple problem as many threads seem outdated.
My current configuration.yaml is
homeassistant:
allowlist_external_dirs:
- "/config/www"
file:
- action: file.read_file
data:
file_name: config/www/myfile2.json
file_encoding: JSON
response_variable: file_content
And the integration is properly setup via the UI File integration as it displays the last single line.
With reading a file I want to achieve reading the config/.storage/lovelace.dashboard.json file. I want to use it for the auto-entities HACS card to only display entities of a certain device which is currently not configured anywhere else in the dashboard