5e5025455213bf2bf2de003ed8013fb89f03c5d5
RelayTV Home Assistant Integration
RelayTV integrates with Home Assistant as a local media_player plus RelayTV-specific services.
Current Feature Set
- Creates a
media_playerentity for each RelayTV config entry. - Uses a hybrid RelayTV state model:
GET /statusfor bootstrap, reconnect, and full refresh fallbackGET /ui/eventsSSE for immediate UI-state updates- authoritative
statusevents plus fast-pathplayback/ refresh-hintqueueandjellyfinevents
- Supports media controls from Home Assistant:
- Play, pause, stop
- Next and previous
- Seek
- Volume set
- Turn on / turn off
- Registers a Home Assistant sidebar panel that embeds the RelayTV UI.
- Supports multi-target synchronized start (
play_synced) using RelayTVPOST /play_at. - Supports snapshots (
snapshot) and exposessnapshot_urlon the entity. - Stores resume positions and provides
play_with_resumebehavior. - Supports optional sensor->stream mappings that trigger temporary playback when a mapped sensor turns
on.
RelayTV Services
| Service | RelayTV endpoint | Notes |
|---|---|---|
relaytv.smart_url |
POST /smart |
One-button play/enqueue behavior from RelayTV |
relaytv.play_now |
POST /play |
Immediate playback; clears queue |
relaytv.announce |
POST /play |
Alias of play_now |
relaytv.play_temporary |
POST /play_temporary |
Temporary interrupt + resume flow |
relaytv.overlay |
POST /overlay |
Text/image overlay |
relaytv.play_synced |
POST /play_at |
Multi-entity time-aligned start |
relaytv.snapshot |
POST /snapshot (fallback GET /snapshot) |
Captures current frame |
relaytv.play_with_resume |
POST /play + POST /seek_abs |
Resume per-URL saved position |
Installation (HACS)
- Open HACS in Home Assistant.
- Add this repository as a custom repository with category
Integration. - Install
RelayTV. - Restart Home Assistant.
- Add the
RelayTVintegration from Settings -> Devices & Services.
Installation (Manual)
-
Copy this repository's
custom_components/relaytvfolder into your Home Assistant config:/config/custom_components/relaytv/ -
Restart Home Assistant.
-
Go to Settings -> Devices & Services -> Add Integration.
-
Search for RelayTV.
-
Enter:
- RelayTV base URL (example:
http://relaytv-host:8787) - Display name for this RelayTV instance
- RelayTV base URL (example:
Options
From the integration options flow, you can configure:
panel_enabled: enable/disable sidebar panel registrationpanel_target_entry_id: which RelayTV config entry is used by the shared sidebar panelsensor_stream_mappings: list of sensor-to-URL mappings for temporary playback triggers
Example Service Calls
service: relaytv.play_now
target:
entity_id: media_player.relaytv_living_room
data:
url: https://www.youtube.com/watch?v=dQw4w9WgXcQ
use_ytdlp: true
cec: false
service: relaytv.play_temporary
target:
entity_id: media_player.relaytv_living_room
data:
url: https://example.com/doorbell-chime.mp3
timeout: 10
volume: 0.6
service: relaytv.overlay
target:
entity_id: media_player.relaytv_living_room
data:
text: Front door opened
duration: 8
position: top-right
Known Limitations
relaytv.play_nowcurrently maps to RelayTVPOST /play(queue-clearing behavior).- RelayTV also exposes
POST /play_now, but this integration does not currently use its preserve-current semantics. - No dedicated
enqueueorclear_queueHome Assistant service is currently registered by this integration. - Overlay calls must include at least
textorimage_url. - Snapshots require active playback on the RelayTV server.
/ui/eventsis treated as a live push stream, not a replay log;/statusremains the reconnect/bootstrap fallback.
Compatibility
Validated against RelayTV app routes in /opt/relaytv/app/relaytv_app/routes.py and API docs in /opt/relaytv/docs/API.md.
Languages
Python
86.4%
JavaScript
10.7%
Shell
2.9%
