Appdaemon file placement

I’ve got my AppDaemon development files in subdirectories below my appdaemon app_dir. I’m wondering if people who install any apps we have published, are installing them in the app_dir, or in subdirectories for each app under the app_dir directory. The reason I ask, is that in some of my apps, I read input sliders, and input booleans from HA to determine what time a light should be turned on or off. I write those values to a application configuration file so that the next time HA restarts, I can re-initialize those controls to the last value they were set at, instead of the default value for the control. Those files are being created in the app_dir directory so in my case since I have things in sub directories, they are not located in the same directory as the app. I’m trying to figure out if this is a problem for other people, or just for me. I make a lot of problems for myself, so it very well could just be me. :slight_smile:

My suggestion would be to always use absolute paths for this type of thing, then there should be no issue.

But my absolute path id definately going to be different from other people’s. my app_dir is under a “code” directory off the home directory ( ~/code/appdaemon ) It helps keeping all my source code together.

If you are going to give it to other people, I think you should allow them to specify where to keep the file as an argument to the app. Have a default that suits you though.

i Always set the full dirpath in the config.

like:

logfile = /home/pi/.homeassistant/logfiles/sound.log
tempspeechfiles = /home/pi/.homeassistant/speechfiles

that way you can Always store everything everywhere (even elsewhere on the network)

1 Like