Open / write a file in directory /config/www

Hello, I’m attempting to open a file located in the /config/www/ directory of Home Assistant using the Python package PIL within my AppDaemon. This file is a camera snapshot that I want to crop.

Here’s the relevant line of code:

im = Image.open('/config/www/test.jpg')

Error:

File “/config/apps/app_daemon_cap_flap.py”, line 12, in onActionFired
im = Image.open(‘/config/www/test.jpg’)

How can I achieve this please?

Hello @alexoueb ,

You should try this :

im = Image.open('/homeassistant/www/test.jpg')

And read this : Public Addon Config | Home Assistant Developer Docs

Have a nice day

1 Like

Thank you very much @bonvga !!!

1 Like