Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDR Tone Remapping control? #40

Open
Mibix opened this issue Dec 5, 2020 · 8 comments
Open

HDR Tone Remapping control? #40

Mibix opened this issue Dec 5, 2020 · 8 comments

Comments

@Mibix
Copy link

Mibix commented Dec 5, 2020

I guess this is more of a question/feature request but is there a way to turn on and off the HDR Tone Remapping from Kodi? Can't figure out how to do it if it is possible.

@zanix
Copy link
Collaborator

zanix commented Apr 16, 2021

Use the dreamscreen.set_hdr_tone_remapping service

image

Or here is a script example

script:
  dreamscreen_hdr_off:
    alias: "DreamScreen - Turn off HDR Tone Mapping"
    sequence:
      - service: dreamscreen.set_hdr_tone_remapping
        data:
          entity_id: dreamscreen.living_room
          hdr_tone_remapping: 0
  dreamscreen_hdr_on:
    alias: "DreamScreen - Turn on HDR Tone Mapping"
    sequence:
      - service: dreamscreen.set_hdr_tone_remapping
        data:
          entity_id: dreamscreen.living_room
          hdr_tone_remapping: 1

@Mibix
Copy link
Author

Mibix commented Apr 17, 2021

Thank you so much I will try later

@zanix
Copy link
Collaborator

zanix commented Apr 18, 2021

I just noticed you asked if it can be toggled in Kodi. This integration is for Home Assistant but the underlying python is a more generic library (https://github.com/J3n50m4t/pydreamscreen)
If you have the Kodi component in Home Assistant, I think you can add an automation trigger when Kodi is playing and then use the service call to toggle the hdr mode.

@Mibix
Copy link
Author

Mibix commented Apr 20, 2021

hmm I am getting this error:

Logger: homeassistant.components.script.dreamscreen_down_hdr_off
Source: helpers/script.py:1324
Integration: Script (documentation, issues)
First occurred: 10:35:41 AM (12 occurrences)
Last logged: 10:36:24 AM

Dreamscreen Down HDR Off: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['remapping']

Here is the entry in my scripts.yaml file:

dreamscreen_down_hdr_off:
  alias: "Dreamscreen Down HDR Off"
  sequence:
    - service: dreamscreen.set_hdr_tone_remapping
      data:
        entity_id: dreamscreen.dreamscreen_4k_d
        remapping: `0`

Not sure what I am doing wrong here, any ideas?

@zanix
Copy link
Collaborator

zanix commented Apr 20, 2021

Looks like "remapping" is not the right attribute.
I just looked at the code and it seems it should be "hdr_tone_remapping"

@Mibix
Copy link
Author

Mibix commented Apr 20, 2021

hdr_tone_remapping

That fixed it, thanks! I don't think I can get it to work on Kodi since I would need the Kodi HA plugin to know when HDR content is being played to function right and switch it. This is still way better than the Dreamscreen app I can just create a tasker shortcut on my phone or hit it from the HA website. Thanks for adding this!

@zanix
Copy link
Collaborator

zanix commented Apr 20, 2021

I just took a quick look at the Kodi API and I don't see an obvious way to get if the current video is HDR
Maybe this? https://kodi.wiki/view/JSON-RPC_API/v12#Player.GetItem
Which contains these fields: https://kodi.wiki/view/JSON-RPC_API/v12#List.Fields.All
I don't see a specific color mode in there though...

Alternatively, if the title of the currently playing video has something like [HDR] in the title of the video you might be able to use that.

@Mibix
Copy link
Author

Mibix commented Apr 20, 2021

Kodi doesn't even natively support all HDR right now so most people have to use an external player like madvr and integrate it, maybe in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants