How to install full Home Assistant Core in Python virtual environment on Debian 11 operating system(x86_64 with python virtual environment) Step by Step

Manual installation Home Assistant Core  on Debian 11 using Python virtual environment。This guide assumes that you already have an operating system setup and have installed Python 3.9 (including the package python3-dev) or newer.

 

Requirements

OS:Debian 11

Python:Python virtual environment

               Home Assistant Core 2022.03

Installation methods

Home Assistant Core:Manual installation using Python virtual environment。

 

How to install full Home Assistant Core  on Debian 11 operating system(with python virtual environment) Step by Step

follow:https://www.home-assistant.io/installation/linux/#install-dependencies

 

root@raspberrypi:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye
Debian 5.10.92-1 (2022-01-18) x86_64
Linux hass 5.10.0-11-amd64

Add an account for Home Assistant Core called homeassistant

sudo useradd -rm homeassistant

 

创建python虚拟环境

python3.3以上的版本使用python的模块venv用于创建和管理python虚拟环境。

create a directory for the installation of Home Assistant Core and change the owner to the homeassistant account.

The new instructions do specify changing the ownership of /srv/homeassistant to homeassistant user immediately after creating it, and then creating the virtual environment as homeassistant user, which should avoid permissions problems.

sudo mkdir /srv/homeassistant

sudo chown homeassistant:homeassistant /srv/homeassistant

 

The installation instructions have an error regarding which user to run the python3 -m venv /srv/homeassistant command as.

sudo -u homeassistant -H -s

cd /srv/homeassistant

python3.9 -m venv .

source bin/activate

创建目录,生成虚拟环境,激活虚拟环境。

 

生成虚拟环境,它会创建目录,如下:

root@hass:/srv/homeassistant# ls -l

total 20

drwxr-xr-x 2 root root 4096 Feb 15 12:21 bin

drwxr-xr-x 2 root root 4096 Feb 15 12:21 include

drwxr-xr-x 3 root root 4096 Feb 15 12:21 lib

lrwxrwxrwx 1 root root    3 Feb 15 12:21 lib64 -> lib

-rw-rw-rw- 1 root root   83 Feb 18 05:15 pyvenv.cfg

drwxr-xr-x 3 root root 4096 Feb 15 12:21 share

激活虚拟环境后,命令行最前面会显示环境名。

在命令行提示符前面会有(homeassistant@hass:)的提示,表示当前你处的python虚拟环境,比如我电脑的情况:

现在你可以在激活环境中干任何事情,比如使用pip命令在你新的python虚拟环境中安装模块.

激活后,你使用的python,指向的就是虚拟环境里的python了,如下:

(homeassistant) root@hass:/srv/homeassistant# which python
/srv/homeassistant/bin/python

(homeassistant) root@hass:/srv/homeassistant# which wheel
(homeassistant) root@hass:/srv/homeassistant# which pip
/srv/homeassistant/bin/pip
(homeassistant) root@hass:/srv/homeassistant# python -V 
Python 3.9.2
(homeassistant) root@hass:/srv/homeassistant# pip -V 
pip 20.3.4 from /srv/homeassistant/lib/python3.9/site-packages/pip (python 3.9)

 

安装依赖包,这步操作要在虚拟环境中做:

homeassistant@hass:/root$python3 -m pip install wheel

使用完该虚拟环境之后,你需要在命令行输入deactivate命令来退出该虚拟环境

Install Home Assistant Core

homeassistant@hass:/root$pip3 install homeassistant

output

Installing collected packages: pip
  WARNING: The scripts pip, pip3 and pip3.9 are installed in '/home/homeassistant/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

 

First boot Home Assistant 

第1次运行

Start Home Assistant Core for the first time. This will automatically creating the .homeassistant configuration directory in the /home/homeassistant directory, and installing any basic dependencies.

在此过程中将会创建配置文件(配置文件位置位于/home/homeassistant/.homeassistant/ 如果发生错误,可以将些文件夹下内容删除,再重新启动 homeassistant)

homeassistant@hass:/root$ hass

 

同时新开一个窗口,实时查看第1次运行日志:

root@hass:~# hass -v

0000000

2022-02-15 12:27:45 INFO (SyncWorker_0) [homeassistant.loader] Loaded google_assistant from homeassistant.components.google_assistant
2022-02-15 12:27:45 INFO (SyncWorker_0) [homeassistant.loader] Loaded alexa from homeassistant.components.alexa
2022-02-15 12:27:45 INFO (SyncWorker_0) [homeassistant.loader] Loaded camera from homeassistant.components.camera

 

Second boot Home Assistant 

正常后

root@hass:~# hass -v
2022-02-15 18:16:17 INFO (MainThread) [homeassistant.bootstrap] Config directory: /root/.homeassistant
2022-02-15 18:16:18 INFO (SyncWorker_1) [homeassistant.loader] Loaded persistent_notification from homeassistant.components.persistent_notification
2022-02-15 18:16:18 INFO (MainThread) [homeassistant.setup] Setting up persistent_notification
2022-02-15 18:16:18 INFO (MainThread) [homeassistant.setup] Setup of domain persistent_notification took 0.0 seconds
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded homeassistant from homeassistant.components.homeassistant
2022-02-15 18:16:18 INFO (MainThread) [homeassistant.setup] Setting up homeassistant
2022-02-15 18:16:18 INFO (MainThread) [homeassistant.setup] Setup of domain homeassistant took 0.0 seconds
2022-02-15 18:16:18 INFO (SyncWorker_1) [homeassistant.loader] Loaded tts from homeassistant.components.tts
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded automation from homeassistant.components.automation
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded default_config from homeassistant.components.default_config
2022-02-15 18:16:18 INFO (SyncWorker_1) [homeassistant.loader] Loaded scene from homeassistant.components.scene
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded script from homeassistant.components.script
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded http from homeassistant.components.http
2022-02-15 18:16:18 INFO (SyncWorker_4) [homeassistant.loader] Loaded blueprint from homeassistant.components.blueprint
2022-02-15 18:16:18 INFO (SyncWorker_4) [homeassistant.loader] Loaded trace from homeassistant.components.trace
2022-02-15 18:16:18 INFO (SyncWorker_1) [homeassistant.loader] Loaded cloud from homeassistant.components.cloud
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded webhook from homeassistant.components.webhook
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded counter from homeassistant.components.counter
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded dhcp from homeassistant.components.dhcp
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded energy from homeassistant.components.energy
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded history from homeassistant.components.history
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded recorder from homeassistant.components.recorder
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded api from homeassistant.components.api
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded auth from homeassistant.components.auth
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded config from homeassistant.components.config
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded device_automation from homeassistant.components.device_automation
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded diagnostics from homeassistant.components.diagnostics
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded lovelace from homeassistant.components.lovelace
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded onboarding from homeassistant.components.onboarding
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded analytics from homeassistant.components.analytics
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded person from homeassistant.components.person
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded image from homeassistant.components.image
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded search from homeassistant.components.search
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded system_log from homeassistant.components.system_log
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded input_boolean from homeassistant.components.input_boolean
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded input_button from homeassistant.components.input_button
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded input_datetime from homeassistant.components.input_datetime
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded input_number from homeassistant.components.input_number
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded input_select from homeassistant.components.input_select
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded input_text from homeassistant.components.input_text
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded logbook from homeassistant.components.logbook
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded map from homeassistant.components.map
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded media_source from homeassistant.components.media_source
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded mobile_app from homeassistant.components.mobile_app
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded tag from homeassistant.components.tag
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded my from homeassistant.components.my
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded network from homeassistant.components.network
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded ssdp from homeassistant.components.ssdp
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded sun from homeassistant.components.sun
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded system_health from homeassistant.components.system_health
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded timer from homeassistant.components.timer
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded usb from homeassistant.components.usb
2022-02-15 18:16:18 INFO (SyncWorker_3) [homeassistant.loader] Loaded updater from homeassistant.components.updater
2022-02-15 18:16:18 INFO (SyncWorker_2) [homeassistant.loader] Loaded zeroconf from homeassistant.components.zeroconf
2022-02-15 18:16:18 INFO (SyncWorker_0) [homeassistant.loader] Loaded zone from homeassistant.components.zone
2022-02-15 18:16:18 INFO (MainThread) [homeassistant.bootstrap] Domains to be set up: {'media_source', 'usb', 'zeroconf', 'input_select', 'updater', 'mobile_app', 'onboarding', 'api', 'scene', 'tts', 'energy', 'webhook', 'frontend', 'counter', 'tag', 'auth', 'config', 'device_automation', 'ssdp', 'default_config', 'input_boolean', 'blueprint', 'person', 'diagnostics', 'input_text', 'cloud', 'recorder', 'lovelace', 'image', 'http', 'history', 'my', 'automation', 'sun', 'zone', 'system_health', 'input_number', 'network', 'trace', 'map', 'input_datetime', 'websocket_api', 'search', 'input_button', 'system_log', 'logbook', 'analytics', 'dhcp', 'timer', 'script'}
2022-02-15 18:16:18 INFO (MainThread) [homeassistant.bootstrap] Setting up logging: {'recorder', 'system_log'}
2022-02-15 18:16:19 INFO (MainThread) [homeassistant.setup] Setting up recorder
2022-02-15 18:16:19 INFO (MainThread) [homeassistant.setup] Setting up system_log
2022-02-15 18:16:19 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds
2022-02-15 18:16:19 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.3 seconds
2022-02-15 18:16:19 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 1: {'person', 'diagnostics', 'websocket_api', 'cloud', 'search', 'webhook', 'frontend', 'lovelace', 'image', 'http', 'system_log', 'analytics', 'auth', 'config', 'device_automation', 'onboarding', 'api'}
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up http
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up device_automation
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain device_automation took 0.0 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain lovelace took 0.1 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.1 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up diagnostics
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up webhook
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain webhook took 0.0 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up auth
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain auth took 0.0 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up config
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up api
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain diagnostics took 0.4 seconds
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setting up image
2022-02-15 18:16:20 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.6 seconds
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setting up search
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setup of domain search took 0.0 seconds
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setting up analytics
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setup of domain image took 0.5 seconds
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setting up person
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setup of domain analytics took 0.1 seconds
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setup of domain person took 0.0 seconds
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setting up onboarding
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 0.0 seconds
2022-02-15 18:16:21 INFO (SyncWorker_2) [homeassistant.loader] Loaded google_assistant from homeassistant.components.google_assistant
2022-02-15 18:16:21 INFO (SyncWorker_1) [homeassistant.loader] Loaded alexa from homeassistant.components.alexa
2022-02-15 18:16:21 INFO (SyncWorker_3) [homeassistant.loader] Loaded hassio from homeassistant.components.hassio
2022-02-15 18:16:21 INFO (SyncWorker_0) [homeassistant.loader] Loaded group from homeassistant.components.group
2022-02-15 18:16:21 INFO (SyncWorker_2) [homeassistant.loader] Loaded device_tracker from homeassistant.components.device_tracker
2022-02-15 18:16:21 INFO (SyncWorker_1) [homeassistant.loader] Loaded panel_custom from homeassistant.components.panel_custom
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setting up frontend
2022-02-15 18:16:21 INFO (SyncWorker_4) [homeassistant.loader] Loaded camera from homeassistant.components.camera
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.1 seconds
2022-02-15 18:16:21 INFO (MainThread) [homeassistant.components.http] Now listening on port 8123
2022-02-15 18:16:21 INFO (SyncWorker_2) [homeassistant.loader] Loaded media_player from homeassistant.components.media_player
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up cloud
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain cloud took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'media_source', 'usb', 'zeroconf', 'input_select', 'updater', 'mobile_app', 'scene', 'tts', 'energy', 'counter', 'tag', 'ssdp', 'default_config', 'input_boolean', 'blueprint', 'input_text', 'sun', 'history', 'my', 'zone', 'automation', 'system_health', 'input_number', 'network', 'trace', 'map', 'input_datetime', 'input_button', 'logbook', 'dhcp', 'timer', 'script'}
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up media_source
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up input_select
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up updater
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up scene
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.components.scene] Setting up scene.homeassistant
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up counter
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up tag
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up input_boolean
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up blueprint
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain blueprint took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up input_text
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up sun
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up history
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up my
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain my took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up zone
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up system_health
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up input_number
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up trace
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain trace took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up map
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up input_datetime
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up input_button
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up logbook
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up dhcp
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain dhcp took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up timer
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain media_source took 0.7 seconds
2022-02-15 18:16:23 INFO (SyncWorker_3) [homeassistant.loader] Loaded binary_sensor from homeassistant.components.binary_sensor
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up usb
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain usb took 0.1 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain scene took 0.7 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain system_health took 0.6 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setting up network
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain network took 0.0 seconds
2022-02-15 18:16:23 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.6 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up script
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up energy
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain energy took 0.0 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain tag took 0.7 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up automation
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up binary_sensor
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain binary_sensor took 0.0 seconds
2022-02-15 18:16:24 INFO (SyncWorker_4) [homeassistant.loader] Loaded google_translate from homeassistant.components.google_translate
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain input_select took 0.8 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain counter took 0.8 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain input_boolean took 0.7 seconds
2022-02-15 18:16:24 INFO (SyncWorker_5) [homeassistant.loader] Loaded sensor from homeassistant.components.sensor
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up tts
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.updater
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.2 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.1 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up sensor
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.0 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain input_text took 0.9 seconds
2022-02-15 18:16:24 INFO (SyncWorker_2) [homeassistant.loader] Loaded notify from homeassistant.components.notify
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up zeroconf
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain input_number took 0.9 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain input_datetime took 0.9 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.9 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain input_button took 0.9 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain timer took 0.6 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.energy
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain zeroconf took 0.1 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up mobile_app
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain mobile_app took 0.0 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.4 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up notify
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain notify took 0.0 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up ssdp
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain ssdp took 0.0 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.components.notify] Setting up notify.mobile_app
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setting up default_config
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.setup] Setup of domain default_config took 0.0 seconds
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 6.56s
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2022-02-15 18:16:24 INFO (MainThread) [homeassistant.core] Timer:starting

 

pip 目录所在位置

/srv/homeassistant/bin

 

root@hass:~# cd /srv/homeassistant
root@hass:/srv/homeassistant# ls -l
total 20
drwxr-xr-x 2 root root 4096 Feb 15 12:21 bin
drwxr-xr-x 2 root root 4096 Feb 15 12:21 include
drwxr-xr-x 3 root root 4096 Feb 15 12:21 lib
lrwxrwxrwx 1 root root    3 Feb 15 12:21 lib64 -> lib
-rw-rw-rw- 1 root root   69 Feb 17 09:02 pyvenv.cfg
drwxr-xr-x 3 root root 4096 Feb 15 12:21 share

 

 

 

MANUALLY START HOME ASSISTANT

sudo -u homeassistant -H -s

cd /srv/homeassistant

version=3.9
python$version -m venv .

source bin/activate

hass

 

先用 Ctrl + C 退出 homeassistant ,再输入exit指令退出 python 虚拟环境。

 

https://community.home-assistant.io/t/installing-home-assistant-core-on-debian-11-with-file-sharing-over-the-network/345702

https://bbs.hassbian.com/thread-11957-1-1.html

 

留下你的评论
*
只有注册用户才能评论。