Custom Component: SkyQ Media Player

I’ve just noticed @Matt_Barnes, when combining the new mini-media-player with the updated skyq component the background changes like this, when recordings are being played:

image

It does revert back to your default image when going back to live tv.

Maybe I should make the enhanced features optional/configurable, in case someone doesn’t want the background image changing in things like the mini-media-player.

Thoughts?

With the currently playing, does this rely on not using the Sky remote to change channels? Do you have to use HA to change channels only.

I’ve been wanting this functionality for a long time!

This component will auto refresh the UI, supporting updates via the remote control.

Not at my computer to confirm but if I recall it’s currently using HA interval defaults right now for the refresh, 15 seconds I believe.

Great component, thanks!

I notice my SkyQ Mini feeds what channel is currently playing into HA, but my main 2TB Box doesn’t, any idea how to get my main box to show what’s playing in HA?

Attached screenshots of my setup. Using mini media player to make a remote, which does all the buttons I need, even volume!

1 Like

I have TV that is no smart: I have broadlink IR, but I want to try to remove it

@jackm Those UI’s are looking great, please do share the config also either here or feel free to raise a Pull Request with example config in GitHub as part of the readme


With regards to your 2TB box issue, I have read about others having similar issues in the thread I based my updates on, I don’t believe they got to the bottom of it but lets give it a go :slight_smile:

I also have a 2TB box, in my living room and its working fine for me. I believe it might be to do with box versions, or ports in use. Mine is about 18 months old if that has any bearing

How familiar confident are you with cURL? If you are familiar I think I can give some pointers later in the week to help you run some tests to get to the bottom of this. In the meantime I’ve added a debug branch to my release, you can run these on the command line on any box with python, so can be your HA box, but can run on any machine, I’m running these on my laptop. https://github.com/MadmanMonty/Home_Assistant_SkyQ_MediaPlayer/tree/debug/skyq

You don’t need the entire content, just the two files sky_remote.py and bash_sky_test.py

On the command line you then run ./bash_sky_test.py <sky_box_ip> it will output loads of debug text, perhaps direct message me output, if you’d like me to try and assist, hopefully, it will give us something to suggest what is wrong.

When you are running it, have a recorded program playing :wink: If you record something common and let me know what it is, I can replicate on my main box to compare outputs.

Also, check out this thread and see if you can spot any pointers to help solve: Sky Q set-top box custom media_player component

How do you get the background image of what you are watching in the skyq decoder? I cannot see it also if i set the artwork option to cover or full-cover.

Its a combination of SOAP and REST requests to the box on different ports.

If you diff my master and skyqa branches and review the skyq_remote.py file it should hopefully paint a picture of the amount of calls and structure. Check out getCurrentMedia function and https://github.com/MadmanMonty/Home_Assistant_SkyQ_MediaPlayer/blob/d7df8bcd29b12a05505a5baf81cc707f5f097ca5/skyq/sky_remote.py#L147 for more specifics details

Sorry, but i am really e noob about programming, so it’s impossible for me now to understand what you mean… :roll_eyes:

this is my attempt… i’ll try to make it better tomorrow :slight_smile:

entity: media_player.sky_q_salone
type: 'custom:mini-media-player'
artwork: cover
source: icon
icon: 'mdi:remote-tv'
name: Sky Q Salone
hide:
  volume: true
  source: false
  power_state: false
shortcuts:
  columns: 3
  buttons:
    - icon: 'mdi:plus-circle'
      type: source
      id: CUP
    - icon: 'mdi:arrow-up-circle'
      type: source
      id: UP
    - icon: 'mdi:home-circle'
      type: source
      id: HOME
    - icon: 'mdi:arrow-left-circle'
      type: source
      id: LEFT
    - icon: 'mdi:checkbox-marked-circle'
      type: source
      id: OK
    - icon: 'mdi:arrow-right-circle'
      type: source
      id: RIGHT
    - icon: 'mdi:minus-circle'
      type: source
      id: CHDOWN
    - icon: 'mdi:arrow-down-circle'
      type: source
      id: DOWN
    - icon: 'mdi:alpha-e-circle'
      type: source
      id: EXIT

This is what i get:

10

How to make the buttons and the texts more readable?

Hi,

I have tried to run the debug as I am having the same issue with the ‘now playing’ not showing anything.

However, when trying to run it I get an error saying ‘no module named xmltodict’. If I comment this out then none of the SOAP requests seem to work.

Happy to try and debug for you.

Cheers

Jonathan

Try:

pip install xmltodict 

That should do it, depending on your OS and setup. Do need to make sure it’s python 3, not 2 in use, I recall having a few troubles with that on my Mac.

If that looks like a it’s anymore complicated than that I will recreate my cURL commands I was using during code/testing as alternative and share.

Sure! Heres the config! The volume is done by sending the requests direct to my Sony TV using the Bravia media player component. Works well :slight_smile:

entity: media_player.skyq_bedroom
hide:
  icon: true
  power: true
  source: false
  volume: true
more_info: false
shortcuts:
  buttons:
    - icon: 'mdi:plus-circle-outline'
      id: CUP
      type: source
    - icon: 'mdi:arrow-up-drop-circle-outline'
      id: UP
      type: source
    - data:
        entity_id: media_player.bedroom_tv
      icon: 'mdi:volume-high'
      id: media_player.volume_up
      type: service
    - icon: 'mdi:arrow-left-drop-circle-outline'
      id: LEFT
      type: source
    - icon: 'mdi:check-circle-outline'
      id: OK
      type: source
    - icon: 'mdi:arrow-right-drop-circle-outline'
      id: RIGHT
      type: source
    - icon: 'mdi:minus-circle-outline'
      id: CDOWN
      type: source
    - icon: 'mdi:arrow-down-drop-circle-outline'
      id: DOWN
      type: source
    - data:
        entity_id: media_player.bedroom_tv
      icon: 'mdi:volume-medium'
      id: media_player.volume_down
      type: service
    - icon: 'mdi:arrow-left-circle'
      id: Back
      type: source
    - icon: 'mdi:record-rec'
      id: Record
      type: source
    - icon: 'mdi:home-circle-outline'
      id: Home
      type: source
    - data:
        entity_id: media_player.bedroom_tv
      icon: 'mdi:power-standby'
      id: media_player.toggle
      type: service
  column_height: 100
  columns: 3
  label: TV Input
  list:
    - data:
        entity_id: media_player.bedroom_tv
        source: HDMI 1
      icon: 'mdi:video-input-hdmi'
      id: media_player.select_source
      name: HDMI 1
      type: service
    - data:
        entity_id: media_player.bedroom_tv
        source: HDMI 2
      icon: 'mdi:video-input-hdmi'
      id: media_player.select_source
      name: HDMI 2
      type: service
    - data:
        entity_id: media_player.bedroom_tv
        source: HDMI 3/ARC
      icon: 'mdi:video-input-hdmi'
      id: media_player.select_source
      name: HDMI 3
      type: service
    - data:
        entity_id: media_player.bedroom_tv
        source: HDMI 4/ARC
      icon: 'mdi:video-input-hdmi'
      id: media_player.select_source
      name: HDMI 4
      type: service
type: 'custom:mini-media-player'

To be honest not much experience with cURL, but if you want me to try something happy to help where I can with some pointers. Feel free to drop me a PM :slight_smile:

Seems to be able to get the right information, just not reporting it back to HA:

Apologies for the screenshot, not at my usual computer.

Thanks

Could you add support for HACs?
Would be great to not have to unzip/replace files manually (I mainly work on my instance from work on lunch - work blocks github downloads).

Hi @Coedy getting this into HACS is my plan.

As I’m new to HACS this week, my thought process is I’ll continue to fine tune this component for another week, then I’ll look into getting this added to HACS for the wider community.

1 Like

Sounds great! It’s working great at the moment and I’m super excited to get the now playing data, or even the channel numbers (if live). Making Automations for Lights off for Sky Cinema, RGB light on if Cbeebies is on (as it is 90% of the day at the moment…) should be fun!

Does it pick up Netflix/Youtube etc?

1 Like

Just to confirm, the skyqa branch now works perfectly for me. For those looking to do automations, I have added the following to my config, which shows what channel or recording is on, or shows ‘Off’ if the box is off.

  - platform: template
    sensors:
      skyq_living_room:
        friendly_name: Sky Q Living Room
        value_template: >-
          {% if (states.media_player.skyq_living_room.state == "off") %}Off{% else %}{{ state_attr('media_player.skyq_living_room', 'media_title') }}{% endif %}
1 Like

So all confirm that the only way for volume is not control SkyQ?
But why all button are mapped and volumes not?