jasonacox / pypowerwall

Python API for Tesla Powerwall and Solar Power Data
MIT License
120 stars 21 forks source link

Change the path .auth & .site files are saved to #82

Closed spoonwzd closed 2 months ago

spoonwzd commented 2 months ago

I'm running pypowerwall in an Unraid docker, but am having to re-perform the setup process each time I make a change to the docker and the image is refreshed.

It would be great to be able to define a custom path for .pypowerwall.auth and other volatile config related files so I can store them outside of the root file structure. Then in Unraid I can redirect a container path to a host path.

How would I achieve this?

jasonacox commented 2 months ago

Hi @spoonwzd - I'm going to assume you mean the pypowerwall proxy container. There are two envrionmental variables you can set:

# PW_AUTH_PATH is used to prefix auth and cache files
PW_AUTH_PATH=/home/user/.secret/

# PW_CACHE_FILE is the absolute path to the .powerwall cache file. If specified it overrides the above.
PW_CACHE_FILE=/home/user/.mypowerwall

If you are using something similar to Powerwall-Dashboard, you can install these configurations in the pypowerwall.env file.

spoonwzd commented 2 months ago

PW_AUTH_PATH was the key to success! Thanks!