Hi,
I spent days to get my file sensor work in Home Assistant. I followed som many manuals and discussions but it will not work.
I have an Raspberry OS with Home Assistant in Python virtual environment installation - followed the official installation guide.
My configuration.yaml:
default_config:
whitelist_external_dirs:
- /config
- /config/www
allowlist_external_dirs:
- /config
- /config/www
sensor:
- platform: file
file_path: /config/test.txt
I get the error “/config/test.txt is not an allowed directory”.
I tried all combination of “config” and “/config” and copied the file to nearly every possible directory on my RPi.
Then I tried it with an HassOS and an Home Assistant Core installation (without the Python virtual environment). In this installations my file sensor worked with the posted configuration.yaml.
So I reinstalled Raspberry OS and HA (Python Venv) and I got the same issues. Nothing will work.
Why is it not working in the official supported Python virtual environment?
Is it possible to access folders outside the virtual environment?
Has anyone a working file sensor in Venv?
Do I have to use an other whitelist_external_dirs setting in an Venv?
Thanks for your help.