2024年11月21日星期四 下午7:18:44

Home Assistant配置文件path

2 年 前
#1198 引用
Home Assistant有两个主要的目录:
一个是配置目录.
有configuration.yaml(配置文件)、.storage(组件信息存储文件夹)、home-assistant.log(程序运行日志)等;
一个是安装目录.
放置有程序核心代码及官方组件代码(components目录)


Home Assistant按配置文件以模块化的方式启用组件。
配置文件的位置是
macOS       ~/.homeassistant/configuration.yaml
Linux       ~/.homeassistant/configuration.yaml
Windows    %APPDATA%\.homeassistant\configuration.yaml

Window下“%APPDATA%”一般位于“c:\users\用户名\AppData\Roaming\”。

If you use Home Assistant Container, you can find configuration.yaml in the config folder that you mounted in your container.

If you use Home Assistant Operating System, you can find configuration.yaml in the /config folder of the installation.

If you use Home Assistant Core, you can find configuration.yaml in the config folder passed to the hass command (default is ~/.homeassistant).

https://www.home-assistant.io/docs/configuration/#Editing%20Configuration.Yaml


Home Assistant OS  /config
Docker Container  /config
OS X  ~/.homeassistant
Linux  ~/.homeassistant
Windows  %APPDATA%/.homeassistant

source:https://siytek.com/home-assistant-configuration-yaml-beginners-guide/

https://www.msly.cn/boards/topic/11346/beginners-guide-to-home-assistant-core-architecture#16597

Linux
配置目录

find config path

find / -name configuration.yaml


output

root@raspberrypi:/var/log# find / -name configuration.yaml
/home/homeassistant20230103/.homeassistant/configuration.yaml
/home/homeassistant20221103/.homeassistant/configuration.yaml
/home/homeassistant20221102/.homeassistant/configuration.yaml
/home/homeassistant/.homeassistant/configuration.yaml
/root/.homeassistant/configuration.yaml



安装目录
# root用户运行
find / -name homeassistant | grep -E 'site-packages|dist-packages'


Home Assistant Configuration YAML (The Beginners Guide)
https://siytek.com/home-assistant-configuration-yaml-beginners-guide/

Have a look at the wiki. It contains information that might help you.

https://github.com/danielperna84/hass-configurator/wiki/Configuration

https://community.home-assistant.io/t/configurator-file-editor-for-ha-core-in-docker/238472
0
2 年 前
#16588 引用
path of Home Assistant core

path of  configuration.yaml

way 1:

http://192.168.101.50:8123/config/info

http://192.168.101.50:8123/config/info

you will get:

Home Assistant core 2022.3.0

Path to configuration.yaml: /home/homeassistant/.homeassistant


way 2: Home Assistant core 2023.3.0
http://192.168.2.50:58123/config/repairs

output
System information

Version  core-2023.10.1
Installation Type  Home Assistant Core
Development  false
Supervisor  false
Docker  false
User  homeassistant20230903
Virtual Environment  true
Python Version  3.11.5
Operating System Family  Linux
Operating System Version  6.1.53-v7+
CPU Architecture  armv7l
Timezone  Asia/Shanghai
Configuration Directory  /home/homeassistant20230903/.homeassistant



way 3:

(hass311) homeassistant@hass:~$ hass --script check_config



output

Testing configuration at /home/homeassistant/.homeassistant
Failed config
  General Errors:
    - Platform error switch.rflink - Exception importing homeassistant.components.rflink.switch

    - Component error: rflink - Exception importing homeassistant.components.rflink




[code](homeassistant20230903) homeassistant20230903@raspberrypi:/srv/homeassistant20230903 $ hass --script check_config
Testing configuration at /home/homeassistant20230903/.homeassistant


root@raspberrypi:~# cd /home/homeassistant/.homeassistant
root@raspberrypi:/home/homeassistant/.homeassistant# ls -l

总用量 1076112
-rw-r--r-- 1 homeassistant homeassistant      8819 10月 29 20:30 automations.yaml
drwxr-xr-x 4 homeassistant homeassistant      4096  3月  3  2022 blueprints
-rw-r--r-- 1 homeassistant homeassistant      5722 10月 18 03:20 configuration.yaml
drwxr-xr-x 7 root          root               4096 10月  4 01:09 custom_components
drwxr-xr-x 2 homeassistant homeassistant      4096  3月  3  2022 deps
-rw-r--r-- 1 homeassistant homeassistant   9178363 10月 29 22:42 home-assistant.log
-rw-r--r-- 1 homeassistant homeassistant 531286018 10月 29 20:45 home-assistant.log.1
-rw-r--r-- 1 homeassistant homeassistant         0 10月 29 20:46 home-assistant.log.fault
-rw-r--r-- 1 homeassistant homeassistant 557129728 10月 29 22:40 home-assistant_v2.db
-rw-r--r-- 1 homeassistant homeassistant     32768 10月 29 22:42 home-assistant_v2.db-shm
-rw-r--r-- 1 homeassistant homeassistant   4235392 10月 29 22:42 home-assistant_v2.db-wal
drwxr-xr-x 3 homeassistant homeassistant      4096  5月 23 01:56 image
-rw-r--r-- 1 homeassistant homeassistant      1141 10月 18 03:22 known_devices.yaml
drwxr-xr-x 2 root          root               4096  3月 24  2022 media
-rw-r--r-- 1 homeassistant homeassistant      2136  8月 31 04:10 scenes.yaml
-rw-r--r-- 1 homeassistant homeassistant         0  3月  3  2022 scripts.yaml
-rw-r--r-- 1 homeassistant homeassistant       161  3月  3  2022 secrets.yaml
drwxr-xr-x 2 homeassistant homeassistant      4096  3月  3  2022 tts


0
1 年 前
#20402 引用
time_zone

homeassistant:
  time_zone: America/Los_Angeles

https://www.home-assistant.io/blog/2015/05/09/utc-time-zone-awareness/
0
1 年 前
#20551 引用
1
0
1 年 前
#22453 引用
path of Home Assistant core

1、homeassistant配置文件所在位置
cd $HOME/.homeassistant
查看位置
pwd
/root/.homeassistant
2、查看hass安装路径:
which hass
/usr/local/bin/hass
3、文件启动目录:
/etc/systemd/system
0
9 个月 前
#28420 引用
path of Home Assistant docker

docker缺省端口配置,第一次产生的文件如下

[code]docker run -d \
  --name ha2 \
  -v /home/homeassistant20221103/.homeassistant:/config \
  -e TZ=Asia/Shanghai \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable


直通模式不能指定端口,缺省配置目录如下



https://computingforgeeks.com/run-home-assistant-in-docker-and-docker-compose

  new file:   .homeassistant/.HA_VERSION
  new file:   .homeassistant/.storage/assist_pipeline.pipelines
  new file:   .homeassistant/.storage/auth
  new file:   .homeassistant/.storage/bluetooth.passive_update_processor
  new file:   .homeassistant/.storage/core.config_entries
  new file:   .homeassistant/.storage/core.device_registry
  new file:   .homeassistant/.storage/core.entity_registry
  new file:   .homeassistant/.storage/core.restore_state
  new file:   .homeassistant/.storage/core.uuid
  new file:   .homeassistant/.storage/homeassistant.exposed_entities
  new file:   .homeassistant/.storage/http
  new file:   .homeassistant/.storage/http.auth
  new file:   .homeassistant/.storage/repairs.issue_registry
  new file:   .homeassistant/.storage/trace.saved_traces
  new file:   .homeassistant/automations.yaml
  new file:   .homeassistant/blueprints/automation/homeassistant/motion_light.yaml
  new file:   .homeassistant/blueprints/automation/homeassistant/notify_leaving_zone.yaml
  new file:   .homeassistant/blueprints/script/homeassistant/confirmable_notification.yaml
  new file:   .homeassistant/configuration.yaml
  new file:   .homeassistant/scenes.yaml
  new file:   .homeassistant/scripts.yaml
  new file:   .homeassistant/secrets.yaml
  modified:   .storage/auth
  modified:   .storage/core.entity_registry
  modified:   .storage/core.restore_state
  modified:   .storage/http

root@raspberrypi:/home/homeassistant20221103#


https://github.com/mslycn/Home-AssistantConfig20221103/commit/beaeabc07def6c0aa0a095a71730463a8243a7b2
0
9 个月 前
#28421 引用
docker ha

docker run -d --name="ha" -e "TZ=Asia/Shanghai" -v "/home/homeassistant20221103:/config" -p 38123:8123 ghcr.io/home-assistant/home-assistant:stable


第一次配置目录如下:

new file:   .HA_VERSION
  new file:   .storage/assist_pipeline.pipelines
  new file:   .storage/auth
  new file:   .storage/bluetooth.passive_update_processor
  new file:   .storage/core.config_entries
  new file:   .storage/core.device_registry
  new file:   .storage/core.entity_registry
  new file:   .storage/core.restore_state
  new file:   .storage/core.uuid
  new file:   .storage/homeassistant.exposed_entities
  new file:   .storage/http
  new file:   .storage/http.auth
  new file:   .storage/repairs.issue_registry
  new file:   .storage/trace.saved_traces
  new file:   automations.yaml
  new file:   blueprints/automation/homeassistant/motion_light.yaml
  new file:   blueprints/automation/homeassistant/notify_leaving_zone.yaml
  new file:   blueprints/script/homeassistant/confirmable_notification.yaml
  new file:   configuration.yaml
  new file:   scenes.yaml
  new file:   scripts.yaml
  new file:   secrets.yaml

root@raspberrypi:/home/homeassistant20221103#

0
9 个月 前
#28480 引用
I use an approach like this:

/data - all my app data lives under here
/data/docker - compose file, environment files, secrets, etc
/data/homeassistant - HA config folder
/data/zigbee2mqtt - Zigbee2MQTT config folder

etc
Then when I back up /data/ I get everything that matters.
https://community.home-assistant.io/t/upgrading-homeassistant-in-docker/645019/22?u=msly
0
8 个月 前
#28563 引用
docker

如果是非ROOT用户应该在 /home/你的用户名/homeassistant 目录下,ROOT用户就不知道了,但是你可以搜索下homeassistant目录

最好自己指定一个路径 docker run -d --net="host" --name="ha" --restart=always --privileged=true -v /home/homeassistant:/config -p 8123:8123  -e TZ="Asia/Shanghai" homeassistant/home-assistant:latest
0
8 个月 前
#28564 引用
1
0