Skip to content

Commit 8b150e7

Browse files
lanratfrenckc0ffeeca7
authored
Added keyboard_remote docker information (home-assistant#27830)
Co-authored-by: Franck Nijhof <frenck@frenck.nl> Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
1 parent 0b95ef2 commit 8b150e7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

source/_integrations/keyboard_remote.markdown

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,29 @@ You can check ACLs permissions with:
165165
```bash
166166
getfacl /dev/input/event*
167167
```
168+
169+
## Containers
170+
171+
If you are running Home Assistant Container, you need to pass the input device through to the container. You can pass the input device you want to use directly into the container with the `--devices` flag. However, restarting the container or unplugging and replugging your keyboard will break this integration. This is because only the instance of the keyboard that existed when the container first started will be available inside the container.
172+
173+
Here is an incomplete example `docker-compose.yml` that allows Home Assistant persistent access to input devices in a container:
174+
175+
```yaml
176+
version: '3.7'
177+
178+
services:
179+
homeassistant:
180+
image: ghrc.io/homeassistant/home-assistant:stable
181+
volumes:
182+
- config:/config/
183+
- /dev/input:/dev/input/ # this is needed to read input events.
184+
restart: unless-stopped
185+
device_cgroup_rules:
186+
# allow creation of /dev/input/* with mknod, this is not enough on its own and needs mknod to be called in the container
187+
- 'c 13:* rmw'
188+
devices:
189+
# since input id may change, pass them all in
190+
- "/dev/input/"
191+
...
192+
193+
```

0 commit comments

Comments
 (0)