Hello guys
I am trying to create a custom file sensor which sends me the complete data from a file and not just the last line of that file.
The idea is to setup a local file which stores all my tasks and through TTS, every morning once I switch off my alarm, it reads me out my tasks for the day.
I am able to save data to local file using command line sensor but the only problem I am facing is in sensing the complete data to TTS.
My current logic is to send the complete content data to a custom file sensor, and make tts read it when I run the automation.
Here is the link for reference of the file.py sensor: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/sensor/file.py
When returning the data, it is returning the last ‘line’ but I want to return the ‘file_data’ itself.
I tried applying this ‘data = data + line’ , but it is not working. Shows ‘unknown’ in the sensor value. (it offcourse shouldn’t work because ‘data’ is not defined earlier in the ‘for’ loop)