-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make files in /app/data persistent #456
Comments
Just tested that even restarting your emhass add-on wipes the de /app/data folder. This a shell inside the running emhass app-on docker container in HAOS using "docker exec -ti emhasscontainerid /bin/bash"
Restart the add-on, so new containerid:
Luckily I had made a backup before restarting the container using "root@5b918bf2-emhass:/app/data# cp -r . /data/backup/" |
@davidusb-geek made a small PR to modify the the Dockerfile to fix this. |
Thanks for your contribution and for fixing this issue |
must admit I haven't tested the fix yet. The devcontainer builds ok and seems to work but I didn't have the time to try it out with a fork of the add-on pointing to my repo in my setup. Is there an easy way to do this? |
In that case maybe this is the best option: https://emhass.readthedocs.io/en/latest/develop.html#docker-run-add-on-method Or any of the other methods presented there concerning the add-on |
But for the add-on I'm not 100% sure, but I think that your fix applies mostly to the docker standalone installation method. |
Yeah I would like to have a look at this issue myself. Looks like there may be a deeper issue at play here. The symlink fix may be a good method of fixing it, I'll try it out. 🤔 |
@davidusb-geek the docker file is the same for both add-on and standalone 👍 |
Yes I know but the HA supervisor seems to have a utility that allow for data persistance after reboot or upgrading. That's what I meant, that this fix will be useful mostly for the standalone docker |
Don't know what you mean exactly by "HA supervisor seems to have a utility that allow for data persistance after reboot or upgrading", I've gone trough the add-on documentation and can only find a reference to the /data folder being used to store persitant data on the HA host. An alternative to symlinking /app/data to a subfolder in /data could be to change line 569 of emhass-master/src/emhass/utils.py from: to
|
Sorry @scruysberghs @davidusb-geek I havent really had mutch time to properly read issues recently. For running EMHASS via docker you can use a volume mount to the /data path :
For running EMHASS via Add-on, change the data path to share: On this thought however, I do believe there is something weird going on with the data files. Will look into this |
The /data path should be persistent unless upgrade or uninstall. The fact that it may not be is a possible sign of issues. |
Update: changing the data path to |
Merged and released on v0.12.7 |
Describe the bug
A clear and concise description of what the bug is.
When I try to run the mpc optimizer with 'load_forecast_method': 'typical' I get the following error message in the log:
To Reproduce
Steps to reproduce the behavior
pass 'load_forecast_method': 'typical' runtime parameter to mpc or day ahead api calls or set the option in the config.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Home Assistant installation type
Your hardware
EMHASS installation type
Additional context
Add any other context about the problem here.
Running v0.12.6. Was hoping the "Solved missing file problem: data_load_cost_forecast.csv" fix in the latest version would also solve this but it didn't.
Also noticed I had to rerun the ml fit after upgrading to the latest version to regenerate the load_forecast_mlf.pkl .
I guess a good solution would be to map the whole /app/data folder to the host to make it persistent? Haven't looked at addon docker structure in detail but from what I can see the /data folder is mapped to the host. Maybe a symlink from /app/data to /data could solve all these ?
The text was updated successfully, but these errors were encountered: