oleksandr 1735b79585
Build Kodi Addon / build (push) Failing after 28s
feat: add HDR Notify service addon for Kodi
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.
2026-03-21 17:39:12 +02:00

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": "..."}
  1. When video playback starts, the addon reads the VideoPlayer.HdrType InfoLabel
  2. Any non-empty value (e.g. hdr10, dolbyvision, hlg) means HDR is active
  3. The addon sends the state to whichever targets are enabled
  4. 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.HdrType InfoLabel was introduced in Kodi 20
  • No external dependencies -- uses Python stdlib only

Installation

  1. Go to the Releases page
  2. Download the latest service.video.hdrnotify-*.zip
  3. In Kodi: Settings > Add-ons > Install from zip file > select the downloaded ZIP
  4. 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
  • 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

License

MIT

S
Description
No description provided
Readme 47 KiB
v1.0.0 Latest
2026-06-01 19:32:39 +00:00
Languages
Python 100%