Skip to content

Commit 5cd1b25

Browse files
authored
Merge pull request #485 from Tzaphkiel/patch-1
Enable BT & BLE in Home Assistant container
2 parents 9a4c1d0 + 51631e0 commit 5cd1b25

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.templates/home_assistant/service.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ home_assistant:
88
volumes:
99
- /etc/localtime:/etc/localtime:ro
1010
- ./volumes/home_assistant:/config
11-
11+
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
12+
devices:
13+
- "/dev/ttyAMA0:/dev/ttyAMA0"
14+
- "/dev/vcio:/dev/vcio"
15+
- "/dev/gpiomem:/dev/gpiomem"
16+
privileged: true

docs/Containers/Home-Assistant.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,22 @@ Random MACs are not a problem for a **client** device like a phone, tablet or la
168168
> In TCP/IP any device can be a client or a server for any protocol. The distinction here is about *typical* use. A mobile device is not usually set up to *offer* services like MQTT or Node-RED. It typically *initiates* connections with servers like Docker containers running on a Raspberry Pi.
169169
170170
It is not just configuration-time SSH sessions that break. If you decide to leave Raspberry Pi random Wifi MAC active **and** you have other clients (eq IoT devices) communicating with the Pi over WiFi, you will wrong-foot those clients each time the Raspberry Pi reboots. Data communications services from those clients will be impacted until those client devices time-out and catch up.
171+
172+
# Using bluetooth from the container
173+
In order to be able to use BT & BLE devices from HA integrations, make sure that bluetooth is enabled and powered on at the start of the (Rpi) host by editing `/etc/bluetooth/main.conf`:
174+
175+
```conf
176+
....
177+
[Policy]
178+
AutoEnable=true
179+
```
180+
181+
After a reboot, check that BT is up:
182+
183+
```sh
184+
(root) # hciconfig
185+
...
186+
UP
187+
...
188+
```
189+
ref: https://scribles.net/auto-power-on-bluetooth-adapter-on-boot-up/

0 commit comments

Comments
 (0)