feat: added home assistant widget

This commit is contained in:
2026-09-21 17:48:09 +02:00
parent 62e760f126
commit e0a27e59b4
9 changed files with 1006 additions and 6 deletions
+27 -1
View File
@@ -9,6 +9,28 @@ An overlay for [DankMaterialShell](https://danklinux.com/docs/dankmaterialshell/
| **Audio** | Master output volume + mute, output device switching, microphone volume + mute, input device switching |
| **Apps** | Per-application volume sliders with individual mute, app icon and what is playing |
| **Performance** | CPU (usage, temperature), memory (used / total), network (rx/tx), disk (root usage, read/write) |
| **Home** | Home Assistant entities you pick: lights (toggle + brightness), numbers (slider over the entity's own min/max/step), switches/fans, media players (volume, mute, play/pause), covers, scenes and scripts, plus read-only sensors |
## Home Assistant
Settings → Plugins → Game Bar:
1. **Home Assistant URL**, e.g. `http://homeassistant.local:8123`
2. **Long-lived access token** — HA profile page → *Security* → *Create token*.
It is stored in `plugin_settings.json`, which is world-readable by default
(`chmod 600` it if that matters to you).
3. **Refresh**, then tick the entities you want in the Home widget.
State is polled (default every 5 s) only while the Home widget is open. The token is handed to
`curl` through the process environment, so it never shows up in the process list.
If a refresh fails, `dms ipc call gameBar homeStatus` shows what the plugin actually sent and got
back. A `401` means Home Assistant rejected the token; compare with
```bash
curl -H "Authorization: Bearer <token>" https://your-ha/api/
```
Note that editing `plugin_settings.json` by hand does not reach a running shell.
### IPC commands
@@ -17,7 +39,10 @@ An overlay for [DankMaterialShell](https://danklinux.com/docs/dankmaterialshell/
| `dms ipc call gameBar toggle` | Toggle the overlay |
| `dms ipc call gameBar open` | Open the overlay |
| `dms ipc call gameBar close` | Close the overlay |
| `dms ipc call gameBar widget audio\|apps\|system` | Show/hide one widget |
| `dms ipc call gameBar widget audio\|apps\|home\|system` | Show/hide one widget |
| `dms ipc call gameBar homeToggle <entity_id>` | Toggle an entity (activates a scene/script/button) |
| `dms ipc call gameBar homeRefresh` | Re-poll Home Assistant now |
| `dms ipc call gameBar homeStatus` | Print URL, token length, HTTP status, entity/picked counts and last error |
| `dms ipc call gameBar resetLayout` | Forget all saved widget positions |
## Settings
@@ -25,6 +50,7 @@ An overlay for [DankMaterialShell](https://danklinux.com/docs/dankmaterialshell/
Settings → Plugins → Game Bar (gear icon):
- **Background dimming** — how dark the desktop behind the overlay gets (0–95%).
- **Home Assistant** — URL, access token, refresh interval, and the entity picker.
- **Reset widget positions** — back to the default arrangement on every monitor.
## License