Kodi service addon that detects HDR/SDR state of the currently playing video and notifies external services: - HyperHDR: toggles tone mapping via videomodehdr JSON-RPC command - Home Assistant: sends HDR state via webhook trigger Supports Kodi 20 (Nexus) and later. Both targets are independently configurable with host, port, SSL, and authentication settings. Includes GitHub Actions workflow to build installable ZIP packages on every push and publish them as release assets on tags.
HDR Notify for Kodi
A Kodi service addon that detects the HDR/SDR state of the currently playing video and sends it to external services -- so they can react automatically without relying on signal auto-detection.
The Problem
HyperHDR provides ambient lighting with HDR tone mapping support, but it needs to know when to apply tone mapping. Automatic detection is unreliable on some setups, causing washed-out colors or incorrect tone mapping. Similarly, you may want Home Assistant to react to HDR content -- for example, adjusting room lighting or triggering scenes.
How It Works
Kodi (playing video)
|
| onAVStarted / onPlayBackStopped / onPlayBackEnded
|
v
HDR Notify (this addon)
|
| reads VideoPlayer.HdrType
|
|--- HyperHDR: POST /json-rpc {"command":"videomodehdr", "HDR": 1|0}
|
'--- Home Assistant: POST /api/webhook/<id> {"hdr": true|false, "hdr_type": "..."}
- When video playback starts, the addon reads the
VideoPlayer.HdrTypeInfoLabel - Any non-empty value (e.g.
hdr10,dolbyvision,hlg) means HDR is active - The addon sends the state to whichever targets are enabled
- When playback stops or ends, it sends SDR (reset) to all enabled targets
Both targets are independent -- you can enable one, both, or neither.
Compatibility
- Kodi 20 (Nexus) and later -- the
VideoPlayer.HdrTypeInfoLabel was introduced in Kodi 20 - No external dependencies -- uses Python stdlib only
Installation
- Go to the Releases page
- Download the latest
service.video.hdrnotify-*.zip - In Kodi: Settings > Add-ons > Install from zip file > select the downloaded ZIP
- Configure the addon via Settings > Add-ons > My add-ons > Services > HDR Notify
Configuration
The addon settings are split into two tabs:
HyperHDR
| Setting | Default | Description |
|---|---|---|
| Enable HyperHDR | On | Toggle HyperHDR notifications |
| Host | 127.0.0.1 |
HyperHDR IP or hostname |
| Port | 8090 |
JSON API port (default HTTPS port: 8443) |
| Use HTTPS | Off | Connect via HTTPS |
| API Token | (empty) | Auth token, if token-based authentication is enabled |
The addon sends the videomodehdr command to the HyperHDR JSON API at /json-rpc.
Home Assistant
| Setting | Default | Description |
|---|---|---|
| Enable Home Assistant | Off | Toggle HA webhook notifications |
| Host | 127.0.0.1 |
Home Assistant IP or hostname |
| Port | 8123 |
HA port |
| Use HTTPS | Off | Connect via HTTPS |
| Webhook ID | (empty) | The webhook ID from your HA automation trigger |
The addon sends a JSON payload to the HA webhook trigger endpoint:
{"hdr": true, "hdr_type": "hdr10"}
No authentication token is needed -- HA webhooks are auth-free by design.
Example Home Assistant Automation
automation:
- alias: "React to Kodi HDR state"
trigger:
- platform: webhook
webhook_id: "kodi_hdr_state"
allowed_methods:
- POST
local_only: true
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.json.hdr }}"
sequence:
- service: light.turn_off
target:
entity_id: light.living_room
default:
- service: light.turn_on
target:
entity_id: light.living_room
Related Projects
- HyperHDR -- Open-source ambient lighting with HDR tone mapping
- Home Assistant -- Open-source home automation platform
- Kodi -- Open-source media center
- CoreELEC -- Lightweight Kodi-focused OS for Amlogic devices