2024年11月24日星期日 上午5:23:27

Installing Home Assistant docker via VMWare Player 17 on windows10

11 个月 前
#24004 引用

Below is the process to entirely remove a device and/or entity in Home Assistant.


1. Backup
2. Shutdown Home Assistant
3. Copy the files
4. Start Home Assistant


backup files

root@debian12:/home/husband# cp -r /homeassistant/*  ./homeassistant20231212

Stop the old HA instance
Stop the new HA instance




0
11 个月 前
#24010 引用
SSH to your HASS machine and move to your config directory and files.

scp myfile.png root@<your_ip>:/root/config/www/myfile.png

scp automations.yaml [email protected]:/homeassistant

192.168.2.3
0
11 个月 前
#24011 引用

step 1: move Third Part Integrations

source:
target: /homeassistant/custom_components/*



root@debian12:/homeassistant/custom_components# ls -l
total 60
drwxr-xr-x  3 root root 4096 Dec 13 05:30 adaptive_lighting
drwxr-xr-x  4 root root 4096 Dec 13 05:30 aqara_bridge
drwxr-xr-x  5 root root 4096 Dec 13 05:44 aqara_gateway
drwxr-xr-x  6 root root 4096 Dec 13 05:44 ble_monitor
drwxr-xr-x  5 root root 4096 Dec 13 05:44 chime_tts
drwxr-xr-x  2 root root 4096 Dec 13 05:30 edge_tts
drwxr-xr-x 10 root root 4096 Dec 13 05:44 hacs
drwxr-xr-x  4 root root 4096 Dec 13 05:44 holidays
drwxr-xr-x  4 root root 4096 Dec 13 05:44 miio_yeelink
drwxr-xr-x  2 root root 4096 Dec 13 05:30 mijia_miot
drwxr-xr-x  4 root root 4096 Dec 13 05:44 nodered
drwxr-xr-x  5 root root 4096 Dec 13 05:32 xiaomi_gateway3
drwxr-xr-x  2 root root 4096 Dec 13 05:30 xiaomi_miio_raw
drwxr-xr-x  5 root root 4096 Dec 13 05:44 xiaomi_miot
drwxr-xr-x  5 root root 4096 Dec 13 05:44 xiaomi_miot_raw






run ok



0
11 个月 前
#24012 引用
step 2: move devices

copy old devices data from the old HA instance to the new HA instance

source:
target:/homeassistant/.storage

homekit_controller-entity-map


-rw-rw-rw- 1 root                  root                      147 2023年 2月11日 core.analytics
-rw-r--r-- 1 homeassistant20221103 homeassistant20221103    2302  6月26日 08:18 core.area_registry
-rw-r--r-- 1 homeassistant20221103 homeassistant20221103   63982 12月13日 13:36 core.config_entries
-rw-r--r-- 1 homeassistant20221103 homeassistant20221103   73301 12月12日 03:36 core.device_registry
-rw-r--r-- 1 homeassistant20221103 homeassistant20221103  640103 12月12日 20:55 core.entity_registry
-rw-r--r-- 1 homeassistant20221103 homeassistant20221103      96 12月12日 03:33 core.logger
-rw-r--r-- 1 homeassistant20221103 homeassistant20221103  136838 12月13日 20:38 core.restore_state



Entities and devices are stored in configuration files in /config/.storage/ (core.device_registry and core.entity_registry respectively). Depending on the type, they may also have an entry in core.config_entries.

not copy as follow:
-rw--w--w- 1 homeassistant20221103 homeassistant20221103     347 2023年 2月12日 core.config
-rw-rw-rw- 1 root                  root                      126 2023年 2月11日 core.uuid


not copy as follow:
-rw-r--r-- 1 root root     490 Dec 13 04:14 http
-rw-r--r-- 1 root root     134 Dec 13 04:10 http.auth



run ok
0
11 个月 前
#24020 引用
1
0
11 个月 前
#24021 引用
1
0
11 个月 前
#24022 引用
1
0
11 个月 前
#24023 引用
进入容器内部

docker exec -it ha /bin/bash



root@debian12:/homeassistant/.storage# docker ps -a
CONTAINER ID   IMAGE                                            COMMAND   CREATED        STATUS                    PORTS                                       NAMES
0b53a0356e8f   ghcr.io/home-assistant/home-assistant:stable     "/init"   2 days ago     Up 32 hours               0.0.0.0:8123->8123/tcp, :::8123->8123/tcp   ha
b371d32a8f5d   ghcr.io/home-assistant/amd64-hassio-supervisor   "/init"   2 months ago   Exited (0) 2 months ago                                               modest_sutherland
b1ba49b42795   ghcr.io/home-assistant/amd64-hassio-supervisor   "/init"   2 months ago   Exited (0) 2 months ago    


                                           angry_bassi

root@debian12:/homeassistant/.storage# docker exec -it ha /bin/bash




0b53a0356e8f:/config# ls -l
total 25216
-rw-r--r--    1 root     root             2 Dec 13 16:24 automations.yaml
drwxr-xr-x    4 root     root          4096 Dec 13 16:24 blueprints
-rw-r--r--    1 root     root           265 Dec 13 16:24 configuration.yaml
drwxr-xr-x   17 root     root          4096 Dec 13 16:30 custom_components
drwxr-xr-x    2 root     root          4096 Dec 13 16:24 deps
-rw-r--r--    1 root     root       9348611 Dec 15 00:27 home-assistant.log
-rw-r--r--    1 root     root          4067 Dec 13 16:42 home-assistant.log.1
-rw-r--r--    1 root     root             0 Dec 13 16:44 home-assistant.log.fault
-rw-r--r--    1 root     root      12193792 Dec 15 00:18 home-assistant_v2.db
-rw-r--r--    1 root     root         32768 Dec 15 00:26 home-assistant_v2.db-shm
-rw-r--r--    1 root     root       4206552 Dec 15 00:27 home-assistant_v2.db-wal
-rw-r--r--    1 root     root             0 Dec 13 16:24 scenes.yaml
-rw-r--r--    1 root     root             0 Dec 13 16:24 scripts.yaml
-rw-r--r--    1 root     root           161 Dec 13 16:24 secrets.yaml
drwxr-xr-x    2 root     root          4096 Dec 13 16:24 tts
0b53a0356e8f:/config#






docker exec -it ha /bin/bash
0
10 个月 前
#28355 引用
升级
要说升级方便 core只要pull一个镜像下来 然后删掉原来的 重新运行就行了
只是少了一键搞定,但是一键搞定出问题了  还不如手动搞
0