2024年11月21日星期四 下午7:08:43

Installing Home Assistant Core 2022.3.0 on Raspberry Pi 3B+ step by step

2 年 前
#3593 引用
Python virtual environment + Home Assistant Core  设置home assistant开机自动启动

Make Python virtual environment + Home Assistant Core run automatically

If we want home assistant to start automatically on boot, we need to make some configurations.

First, we need to create a service file to control Home Assistant. core

Create/edit it here: /etc/systemd/system/home-assistant@<YOUR_USER>.service


$ sudo vi /etc/systemd/system/[email protected]


homeassistant is the parameter set by <YOUR_USER>

Enter these into the file:


[Unit]
Description=Home Assistant core  Service
After=network.target

[Service]
Type=simple
User=%i
WorkingDirectory=/home/%i/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/%i/.homeassistant"
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target



Info. %i is the parameter set by running the service. @pi will substitute %i with just ‘pi’.

‘After=network-online.target’ means that the service will start after network connection is established.

ExecStart is the line that will start Home Assistant with the path to the config file.

Read more here about hass (Home Assistant) options: https://www.home-assistant.io/docs/tools/hass/


DETAIL:

systemctl status network-online.target


OUTPUT

network-online.target - Network is Online
     Loaded: loaded (/lib/systemd/system/network-online.target; static)
     Active: active since Mon 2022-05-09 00:54:25 CST; 19min ago
       Docs: man:systemd.special(7)
             https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

5月 09 00:54:25 raspberrypi systemd[1]: Reached target Network is Online.



sudo systemctl enable [email protected]
sudo systemctl start [email protected]
sudo systemctl restart [email protected]
sudo systemctl stop [email protected]
sudo systemctl status [email protected]

sudo journalctl -fu [email protected]


sudo systemctl daemon-reload

sudo systemctl restart [email protected]


https://www.raspberryfield.life/2020/06/14/getting-started-with-home-assistant-core-installing/#BP043-ha-installing-core
https://bbs.hassbian.com/thread-5784-1-1.html
0
2 年 前
#3680 引用
1
0
2 年 前
#3823 引用




python3 --version
0
1 年 前
#18827 引用
1
0
1 年 前
#18828 引用
How to Update Debian operating system

Update the local package database cache with:

sudo apt update

And then update all the installed software, kernel and other system components at once using:

sudo apt upgrade


https://linuxhandbook.com/update-debian/

https://linuxnightly.com/how-to-upgrade-debian

How to Upgrade Raspbian Stretch to Raspbian Buster
https://pimylifeup.com/upgrade-raspbian-stretch-to-raspbian-buster/
0
1 年 前
#18829 引用
因要适用 bluetooth integration,而bluetooth integration 对硬件和软件版本有要求,所以对Host Operation System 进行了升级。20221122  updated


第二次升级到 debian 11.5后  20221122

root@raspberrypi:~# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"


Kernel version: displays system information
root@raspberrypi:~# uname -a
Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux


cat /etc/debian_version
11.5


root@raspberrypi:~# hostnamectl
   Static hostname: raspberrypi
         Icon name: computer
        Machine ID: d34c7540b460e4c94a7b3d25
           Boot ID: da14c2f02c89c8d398b
  Operating System: Raspbian GNU/Linux 11 (bullseye)
            Kernel: Linux 4.19.66-v7+
      Architecture: arm

0
1 年 前
#18932 引用
第三次升级到 debian 11.6后  20230205

# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
# uname -a
Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
# cat /etc/debian_version
11.6




How to Update Debian Kernel version

Debian更换内核版本——通过官方快照获取指定内核版本的源

有时候我们需要对服务器更换指定的内核版本,但是通过apt search linux-image*却搜索不到我们想要版本。这是因为历史版本已经归档,不再默认源提供了。我们可以通过去寻找归档路径,也就是快照,来获相应的源,从而进一步更换指定的内核。

https://blog.csdn.net/zhungcan/article/details/110956590
0
1 年 前
#20063 引用
对以上的这个启动脚本做个解释,其中的 User=%i, 这个 %i (Instance) 其实就是 服务名里面 @ 后面部分,也就是 homeassistant 。也就是说,要启动多个服务的话,只要在一个新的 HOME 下, 例如 /home/newuser 下配置好 .homeassistant 目录里,无需添加其他脚本,我们可以启动一个新的服务:systemctl start homeassistant@newuser 即可。(当然里面的端口号要修改)怎么修改启动的端口(例如 8122 )呢?修改 configuration.yaml,把其中的 http: 部分修改成如下即可。
0
1 年 前
#20064 引用
虚拟机主机名设为 lamp-u02。你问为什么要用虚拟机啊,就是为了隔离啊, 测试的东东不想和其他系统混杂,所以,我们的三台物理机的集群里,安装了很多七七八八的各种虚拟机。
0
1 年 前
#20514 引用

(homeassistant20230504) homeassistant20230504@raspberrypi:/srv/homeassistant20230504 $ $HOME
bash: /home/homeassistant20230504:是一个目录

0