2024年5月14日 12:29:09

Where Is Current Configuration Stored while Home Assistant helpers created in the gui? (.storage directory)

1 年 前
#17737 引用
.storage

Where Is Current Configuration Stored while Home Assistant helpers  created in the gui?

they are hidden files in the .storage directory.

Usually the file manager will hide folders that start with a dot by default, but it should give you an option to make them visible. E.g. if you have the folder mapped to your machine, using the default File Manager in Ubuntu, pressing CTRL-H will toggle between showing/hiding hidden files.

It depends on how you’re accessing the files.





0
1 年 前
#17738 引用


Software Requirement

tree -L 3 --dirsfirst


repairs.issue_registry

.Server  software
Raspberry Pi 3B
└── .Debain 11/12 OS
    │   ├──Python -> Python Version  3.9.2
    │   │   ├──Python virtual environment
    │   │   │   ├── Home Assistant Core 2022.3.0
    │   ├── /home/homeassistant/.homeassistant
    │   │   ├──/.storage  -> /home/homeassistant/.storage
    │   │   │   ├── core.config_entries.json
    │   │   │   ├── core.device_registry.json
    │   │   │   ├── core.entity_registry.json
    │   │   │   ├── homekit_controller-entity-map.json
    │   │   │   ├── homekit_controller-entity-map.json
    │   │   │   └── repairs.issue_registry.json
    │   │   ├── /.HA_VERSION   -  2023.9.3
    │   │   ├── /configuration.yaml   -  
    │   │   ├── /automations.yaml   -
    │   │   ├── /scenes.yaml
    │   │   ├── /scripts.yaml
    │   │   ├── /secrets.yaml
    │   │   ├── /.Storage
    │   │   ├── /.Media
    │   │   ├── /tts/
    │   │   ├── /deps/
    │   │   ├── /blueprints/
    │   │   └── /.homeassistant/home-assistant_v2.db  
    │   ├── /srv/homeassistant20221103
    │   └── Python
    │       └── Python virtual environment
    ├── service  -->/etc/systemd/system/[email protected]
    ├── ssh server
    ├── nginx with let’s
    ├── frp
    └── git   /home/homeassistant/.homeassistant/.gitignore

Make Python virtual environment + Home Assistant Core run automatically



1. 目录位置
Home Assistant有两个主要的目录
一个是配置目录,有configuration.yaml(配置文件)、.storage(组件信息存储文件夹)、home-assistant.log(程序运行日志)等;

一个是安装目录,放置有程序核心代码及官方组件代码(components目录)


/etc/systemd/system

http://localhost:4999/boards/topic/1100/home-assistant%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6path#1198


[/code]





These are stored in a hidden folder \config\.storage and there is one text file for each helper type.

It is not recomended to edit these files and the best way to do this for your situation might be to configure the helpers in yaml rather than via the gui so that they can be copied around easily.




root@raspberrypi:~# cd /home/homeassistant20221102/.homeassistant
root@raspberrypi:/home/homeassistant20221102/.homeassistant# cd .storage
root@raspberrypi:/home/homeassistant20221102/.homeassistant/.storage# ls -l
总用量 448
-rw------- 1 homeassistant20221102 homeassistant20221102   5955 11月 15 01:22 auth
-rw------- 1 homeassistant20221102 homeassistant20221102    419 11月 14 06:53 auth_provider.homeassistant
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102    147 11月 13 08:17 core.analytics
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102   1278 11月 13 17:49 core.area_registry
-rw------- 1 homeassistant20221102 homeassistant20221102    322 11月 13 08:15 core.config
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102   7599 11月 15 00:55 core.config_entries
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102  43928 11月 15 00:55 core.device_registry
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102 104074 11月 15 00:55 core.entity_registry
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102  25624 11月 15 01:10 core.restore_state
-rw------- 1 homeassistant20221102 homeassistant20221102    126 11月 13 07:42 core.uuid
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102    319 11月 15 01:18 frontend.user_data_a0d60e23f70942b4a9e811b4d827d959
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102  36084 11月 15 00:25 homekit_controller-entity-map
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102    267 11月 15 00:28 http
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102    134 11月 13 07:23 http.auth
-rw-r--r-- 1 homeassistant20221102 homeassistant20221102    619 11月 13 20:48 input_boolean




[code]

root@raspberrypi:/home/homeassistant20221102/.homeassistant/.storage# cat input_boolean
{
  "version": 1,
  "m
0
1 年 前
#17742 引用

0b53a0356e8f:/config/.storage# ls -a core*

core.analytics       
core.config          
core.device_registry
core.logger          
core.uuid
core.area_registry    
core.config_entries  
core.entity_registry  
core.restore_state




Can you backup and then delete .storage/homekit_controller-entity-map. (This will be in the same folder as your configuration yaml).

Then restart Home Assistant. This will force Home Assistant to re-probe the hub to discover entities. Normally this is automatic, but it might not have worked for you.
0
1 年 前
#17743 引用
Aqara

Attached to the 2662 bridge I can see these accessories:

The hub itself
the "security system" entity is part of the hub
A light bulb that is also part of the hub, at least in terms of how they setup the characteristics
Combined Temp/Humidity/Battery sensor
Windows and Door sensor x 3
Motion sensor x 2
Vibration sensor x 2
AK049 Switch comprising of 3 on/off switches
I can't see any unsupported accessories or anything, it just looks like your switch is not there.

This data is gathered by asking the hub for information about all accessories, services and characteristics. As you have the latest version of this file, it means your Hub is not currently allowing HomeKit to see the switch. I'm sorry i'm not familiar enough with Aqara to know if there is some trick to make it enable new devices for HomeKit.
0
1 年 前
#20084 引用
这core.restore_state到底是根据什么生成的啊,我试过把设备断电了,再删除了整个.storage文件夹,重启ha还是会生成原来的已删除的实体代码


可能和mqtt的机制有关。
mqtt设备有遗嘱信息(will message),导致即使把.storage删除了,mqtt服务器上仍然遗存有相关的遗嘱信息。ha重启后,会从订阅的mqtt主题中获取到设备的mqtt状态,导致.storage中再次出现。

0
7 个月 前
#22505 引用
Manually Deleting Devices and Entities in Home Assistant
https://blog.tiga.tech/posts/deleting-devices-and-entities-in-home-assistant/

Shutdown Home Assistant
Backup
In each file, search for references to the name of the device or entity you want to remove.
Delete the entire section for that object.

core.device_registry
core.entity_registry
core.config_entries

Make sure you keep the syntax correct!
Start Home Assistant
0
4 个月 前
#24041 引用
1
0
4 个月 前
#24044 引用
Where are helpers stored when created in the gui?

where are helpers stored when created within the gui, can i take the file from one installation and add it to a new installation to have all the helpers already without having to restore something? like is there a helpers file or something?


https://community.home-assistant.io/t/where-are-helpers-stored-when-created-in-the-gui/347556
0
4 个月 前
#24069 引用
Device Registry

Reading the developer documentation on the device registry
https://developers.home-assistant.io/docs/device_registry_index/

0
4 个月 前
#24105 引用
.storage/auth

logout ,relogin



{
        "id": "9826362fa6d04789b9c9d34a4674d83e",
        "user_id": "ba9fff3afe634559b817175797cda79a",
  @@ -372,7 +356,7 @@
        "access_token_expiration": 1800.0,
        "token": "d0d237ea851e2df5a4fb0aeaed67aafc0689f2f6743a3a527e7e186710ed7145af71fd9c7de3d682e6684bb536eb4428f0fe2a36faf67e51266fc3a9301e4568",
        "jwt_key": "80304eaedf1a8c7038e521e6690afa8add4e767931146761501ee7b11cfed79c3fe748ccdf1fcd7351ead9d4cc5e6e0a125a66ebf949b55f44617dea4e1dd541",
        "last_used_at": "2023-12-23T09:43:40.077159+00:00",
        "last_used_ip": "118.248.36.32",
        "credential_id": "2093138e4bfb4cb3ad4597a5c4946f6e",
        "version": "2023.9.3"
  @@ -404,7 +388,23 @@
        "access_token_expiration": 1800.0,
        "token": "a9f2b4c93c58d443d5a6508e42e229f97cf5d95a0f9e5951d8fbbe39c5eaca5d679cf03a8e704a88bfb852acdaf2b1e5d0b4f5bd55cd8f403887d71308156949",
        "jwt_key": "352587d5c17deb6e403c11cc7a7800a5669ee39e741e3912710ee871c262d561c750f22737d03a3933ad859bf1254ddd424eb333f9a53704361979b198613008",
        "last_used_at": "2023-12-21T20:30:30.706756+00:00",
        "last_used_ip": "192.168.2.21",
        "credential_id": "2093138e4bfb4cb3ad4597a5c4946f6e",
        "version": "2023.9.3"
      },
      {
        "id": "3aa41b205f434caf94b56612ce5e81e5",
        "user_id": "ba9fff3afe634559b817175797cda79a",
        "client_id": "http://192.168.2.50:38123/",
        "client_name": null,
        "client_icon": null,
        "token_type": "normal",
        "created_at": "2023-12-23T09:56:42.565567+00:00",
        "access_token_expiration": 1800.0,
        "token": "d4ea1f22f327987d61588074d057e467000a0d6c270e6217d4d903b7a4af1ab58d44ccd742534f5cd12789e8f6d856cb678e5a806ac2817b677761b7dca8b83f",
        "jwt_key": "690f4822658fb70d76edd8edfdd867cc87ab6aad8368fe7f0dde2374971ee8b0225ba3a775f8be6a546cd8caeae7792bd466af3b53c212cbf2fdb78cd2895108",
        "last_used_at": "2023-12-23T09:56:42.566186+00:00",
        "last_used_ip": "192.168.2.21",
        "credential_id": "2093138e4bfb4cb3ad4597a5c4946f6e",
        "version": "2023.9.3"

0