792f6905aba536f78b7a418bd47706697b8ebd3b
Resolve all targeted RelayTV config entries for service calls so overlay, play, snapshot, resume, and other targeted actions execute across multiple selected Home Assistant entities or devices instead of only the first target.
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. - Polls RelayTV
GET /statusevery 3 seconds. - 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 (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).- No dedicated
enqueueorclear_queueHome Assistant service is currently registered by this integration. - Overlay calls must include at least
textorimage_url. - Integration uses local polling; it does not currently use WebSocket push updates.
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%