flobz / psacc-ha

psa_car_controller addons for Home Assistant
GNU General Public License v3.0
42 stars 44 forks source link

Changing default electricity cost #21

Closed nosuchuser closed 2 years ago

nosuchuser commented 2 years ago

Is there any straightforward way to change the electricity cost parametrized for the PSA Car Controller HA add-on?

The standalone python project allows changing the config.ini file to enter the default price per kWh, is there a similar way to do this on HA? Even if it involves acessing the filesystem directly?

Thanks

flobz commented 2 years ago

yes it works in the same way. edit the config.ini file

duanra08 commented 1 year ago

Hello flobz, I don't find the folder where you find config.ini file in HA Can you give the way? Because in docker, it's easy to find it

Thank you for you help and your job!

nosuchuser commented 1 year ago

It took me a while to figure that out as well. I had to install this SSH/Terminal add on on HA: https://github.com/hassio-addons/addon-ssh Once you enable and SSH to the HA host, you can use the built in "docker" commands to extract config.ini from the container, change it and send it back inside the container to have the value filled in.

Let me know if you manage to do it or if you want further instructions.

duanra08 commented 1 year ago

It took me a while to figure that out as well. I had to install this SSH/Terminal add on on HA: https://github.com/hassio-addons/addon-ssh Once you enable and SSH to the HA host, you can use the built in "docker" commands to extract config.ini from the container, change it and send it back inside the container to have the value filled in.

Let me know if you manage to do it or if you want further instructions.

Hello nosuchuser, I have SSH/Terminal in my HAOS, but if I would like to use Docker command as "docker container ls", I have this message: "bash: docker: command not found" Can you help me?

nosuchuser commented 1 year ago

@duanra08

Check again. The link for the SSH/Terminal I provided is an enhanced version of the provided SSH add-on by Home Assistant. This one I linked on my reply above has the "docker" command built-in

duanra08 commented 1 year ago

@nosuchuser a big thank you for your help! Now, all is OK!

pika28 commented 1 year ago

Hello,

I managed to move forward thanks to you with this new addon that allows you to use docker commands.

I manage to make a "docker ps" and I finally see psa car controller.

Now how to extract or modify the config.ini file?

Thanks

pika28 commented 1 year ago

I tried this command but I get access denied : docker exec -it addon_abcb0dfb_psacc /bin/sh -c /psa_car_controller

nosuchuser commented 1 year ago

you can do like this. get your container ID using "docker ps"

~ docker ps
CONTAINER ID   IMAGE                                                           COMMAND                  CREATED        STATUS        PORTS                                       NAMES
(...)
5a3ed253528c   flobz/psa_car_controller:v2.6.0                                 "/bin/sh -c /psa_car…"   7 days ago     Up 7 days     0.0.0.0:5000->5000/tcp, :::5000->5000/tcp   addon_b9f12d83_psacc
(...)

then

~ docker cp 5a3ed253528c:/data/config.ini config.ini
~ # change the file at will
~ docker cp config.ini 5a3ed253528c:/data/config.ini