Skip to content

Commit 2f20db8

Browse files
authored
breaking change: homeassistant upgrade os and python3 (#1550)
* breaking change: homeassistant upgrade os and python3 * update json to new date and new ressource values
1 parent b04dc02 commit 2f20db8

File tree

3 files changed

+35
-34
lines changed

3 files changed

+35
-34
lines changed

ct/homeassistant-core.sh

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/usr/bin/env bash
22
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck (tteckster)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: tteck (tteckster) | Co-Author: MickLesk (CanbiZ)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://www.home-assistant.io/
77

88
# App Default Values
99
APP="Home Assistant-Core"
1010
var_tags="automation;smarthome"
1111
var_cpu="2"
12-
var_ram="1024"
13-
var_disk="8"
12+
var_ram="2048"
13+
var_disk="10"
1414
var_os="ubuntu"
15-
var_version="24.04"
15+
var_version="24.10"
1616
var_unprivileged="1"
1717

1818
# App Output & Base Settings
@@ -51,10 +51,6 @@ function update_script() {
5151
echo -e "${GN}Updating to Stable Version${CL}"
5252
BR=""
5353
fi
54-
if [[ "$PY" =~ ^python3\.(11|12)\.[0-9]+$ ]]; then
55-
echo -e "⚠️ Home Assistant will soon require Python 3.13.x";
56-
fi
57-
5854
msg_info "Stopping Home Assistant"
5955
systemctl stop homeassistant
6056
msg_ok "Stopped Home Assistant"
@@ -75,7 +71,7 @@ function update_script() {
7571
if [ "$UPD" == "2" ]; then
7672
msg_info "Installing Home Assistant Community Store (HACS)"
7773
apt update &>/dev/null
78-
apt install unzip &>/dev/null
74+
apt install -y unzip &>/dev/null
7975
cd .homeassistant
8076
bash <(curl -fsSL https://get.hacs.xyz) &>/dev/null
8177
msg_ok "Installed Home Assistant Community Store (HACS)"
@@ -102,16 +98,19 @@ function update_script() {
10298
msg_ok "Installed FileBrowser"
10399

104100
msg_info "Creating Service"
105-
service_path="/etc/systemd/system/filebrowser.service"
106-
echo "[Unit]
101+
cat <<EOF > /etc/systemd/system/filebrowser.service
102+
[Unit]
107103
Description=Filebrowser
108104
After=network-online.target
105+
109106
[Service]
110107
User=root
111108
WorkingDirectory=/root/
112109
ExecStart=/usr/local/bin/filebrowser -r /root/.homeassistant
110+
113111
[Install]
114-
WantedBy=default.target" >$service_path
112+
WantedBy=default.target
113+
EOF
115114

116115
systemctl enable --now -q filebrowser.service
117116
msg_ok "Created Service"
@@ -130,4 +129,4 @@ description
130129
msg_ok "Completed Successfully!\n"
131130
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
132131
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
133-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8123${CL}"
132+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8123${CL}"

install/homeassistant-core-install.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,36 @@ $STD apt-get install -y \
4444
libavfilter-dev \
4545
libmariadb-dev-compat \
4646
libatlas-base-dev \
47-
software-properties-common
47+
software-properties-common \
48+
libmariadb-dev \
49+
pkg-config
4850
msg_ok "Installed Dependencies"
4951

50-
msg_info "Setup Python3"
51-
$STD add-apt-repository -y ppa:deadsnakes/ppa
52+
msg_info "Setup Python3/pip"
5253
$STD apt-get update
54+
$STD rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
55+
$STD apt-get remove --purge -y python3.12 python3.12-dev python3.12-venv
56+
5357
$STD apt-get install -y \
54-
python3.13-* \
58+
python3.13 \
5559
python3-pip \
5660
python3.13-dev \
5761
python3.13-venv
58-
msg_ok "Setup Python3"
5962

60-
msg_info "Installing UV"
61-
$STD pip install uv
62-
msg_ok "Installed UV"
63+
ln -sf /usr/bin/python3.13 /usr/bin/python3
64+
msg_ok "Setup Python3"
6365

6466
msg_info "Setting up Home Assistant-Core environment"
6567
mkdir /srv/homeassistant
6668
cd /srv/homeassistant
67-
uv venv . &>/dev/null
69+
python3 -m venv .
6870
source bin/activate
69-
msg_ok "Created virtual environment with UV"
71+
msg_ok "Created virtual environment"
7072

71-
msg_info "Installing Home Assistant-Core and packages"
72-
$STD uv pip install webrtcvad wheel homeassistant mysqlclient psycopg2-binary isal
73+
msg_info "Installing Home Assistant-Core"
74+
$STD python3 -m pip install webrtcvad wheel homeassistant mysqlclient psycopg2-binary isal
7375
mkdir -p /root/.homeassistant
74-
msg_ok "Installed Home Assistant-Core and required packages"
76+
msg_ok "Installed Home Assistant-Core"
7577

7678
msg_info "Creating Service"
7779
cat <<EOF >/etc/systemd/system/homeassistant.service
@@ -97,4 +99,4 @@ customize
9799
msg_info "Cleaning up"
98100
$STD apt-get -y autoremove
99101
$STD apt-get -y autoclean
100-
msg_ok "Cleaned"
102+
msg_ok "Cleaned"

json/homeassistant-core.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"categories": [
55
2
66
],
7-
"date_created": "2024-04-29",
7+
"date_created": "2025-01-17",
88
"type": "ct",
99
"updateable": true,
1010
"privileged": false,
@@ -19,10 +19,10 @@
1919
"script": "ct/homeassistant-core.sh",
2020
"resources": {
2121
"cpu": 2,
22-
"ram": 1024,
23-
"hdd": 8,
22+
"ram": 2048,
23+
"hdd": 10,
2424
"os": "ubuntu",
25-
"version": "24.04"
25+
"version": "24.10"
2626
}
2727
}
2828
],
@@ -40,12 +40,12 @@
4040
"type": "warning"
4141
},
4242
{
43-
"text": "Use Ubuntu 24.04 ONLY",
43+
"text": "Use Ubuntu 24.10 ONLY",
4444
"type": "warning"
4545
},
4646
{
4747
"text": "config path: `/root/.homeassistant`",
4848
"type": "info"
4949
}
5050
]
51-
}
51+
}

0 commit comments

Comments
 (0)