Custom Component: SkyQ Media Player

Seems to be the version of Python I have installed. Works with Python 3.7. Now to see if I can figure out why I don’t get ‘Now Playing’ on my main box…

On my Q Mini get data from the GetMediaInfo call but for the main box I get

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <s:Body>
        <s:Fault>
            <faultcode>s:Client</faultcode>
            <faultstring>UPnPError</faultstring>
            <detail>
                <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
                    <errorCode>401</errorCode>
                    <errorDescription>Invalid action</errorDescription>
                </UPnPError>
            </detail>
        </s:Fault>
    </s:Body>
</s:Envelope>

I’ve populated the URL in the same way with different IP and control URL

EDIT: Ahhhh. Looks like SkyPlay appears on Description 0 and Description 1 with slightly different URLs. One starts 5276 the other starts 5376. Description 1 work, but Description 0 doesn’t.

Great to hear done headway had been made. Would love to get my “now playing” working. I love the fact that sky is working anyway, but having the now playing work would be the icing on the cake!

Well I edited sky_remote.py in two places. in ./custom_components/skyq and ./custom_components/skyq/skyq.

I changed this

        self._soapControlURl = self._getSoapControlURL(0)
        if (self._soapControlURl is None):
            self._soapControlURl = self._getSoapControlURL(1)

to

        self._soapControlURl = self._getSoapControlURL(1)
        if (self._soapControlURl is None):
            self._soapControlURl = self._getSoapControlURL(0)

And it now works on both boxes. It does mean it is doing a redundant call to my Sky Mini all the time which fails, but on the other hand the main box works and only needs one call.

1 Like

Thank you!
Changed it, restarted and it now works!

Can or has anyone looked into getting metadata showing for live TV?
I would have a guess that it has to do with XMLTV feeds?
There was a custom plugin that had this in it but the project died as far as I could tell
Would love to have this and would make this perfect for me.

Another problem I see is that when my SkyQ box goes into deep sleep (2.45am-5.45am), I get very regular errors in my logs - about 400. I’ve seen before that when it goes into deep sleep it disconnects from the network (I suspect a Wake On LAN would probably still work).

Anyone else seeing this?

Finally, I see it doesn’t return the current App (such as Netflix). This I think is because of two things - firstly Upgrade is spelt incorrectly when trying to upgrade to a web socket, secondly I don’t think you can call a websocket in the same way as a standard http connection in Python. I only wish I had the time available to learn how to code websockets, but I think that is outside the time I have available at the moment.

EDIT: This looks to be the ‘source’ of much of the code and I can see it has been changed from a websokcte call to a rest call. At some point I might have a go at adding it, not sure if it would work on Hassio though since it needs a websocket library which might not be there. Don’t hold your breath.

Bodge fix alert -
I know this wont fix the errors… but could you not make an automation that fires just before the system usually goes to deep sleep (lets say 1am) that toggles its box status to on, wait a few seconds, then back to off? Which I presume would reset it’s deep sleep timer until when someone gets up in the morning?

Like I say, it wont fix the issue of why the errors are appearing, but it would stop the opportunity for errors to generate for the time being?
As 400 each evening is quite a lot… (I’ve not checked my logs yet…)

I could just turn it off ECO mode… and help to kill the planet more :face_with_head_bandage:

I’ve made a minor change to the code to try and handle the exception, I’ll see if that works over night. I may end up doing some sort of fork and submitting it back to Madmanmonty.

I’ve submitted a pull request to add some error handling so that when the box goes to sleep (or get’s switched off), the logs don’t fill up with errors.

Also to reverse the order of retrieval of Description (and handle an error that was happening when it retrieved only one service as part of the call).

1 Like

Hi guys,
i’ve successful installed the addon, but when i add sources, ha failed to start. What’s wrong? There’s a limit in number of sources? I have generate switch on true

The problem seems to be the

switch:

  • platform: template
    switches: !include skyqmansarda.yaml/

If i add those lines, my HASS.IO won’t start at all. I need to remove that from my config.yaml
What’s my mistake? How can i add switches to lovelace?

What are the names of your Sources that you added? I’m wondering if there is any special character or something that is breaking the yaml of that file and making it unreadable.
Also, is that ‘/’ at the end a typo? Or is that actually on the line in your config? There shouldn’t be anything after “.yaml”

Yes, the / it’ a typo, there’s nothing after yaml. I’ve checked for any special char or something like that but i’ve tried with only 3 sources named: SkyTg24, Ra1, Rai2
Any ideas? How can i check the error if hass.io won’t start at all?

What is in the included yaml file, is it valid switch configuration?

This is the generated yaml file

  skyq_pausemansarda:
      value_template: '{{"off"}}'
      friendly_name: 'pause in the Mansarda'
      turn_on:
        service: media_player.media_pause
        data:
          entity_id: media_player.skyq_mansarda
      turn_off:
        service: script.placeholder
    skyq_playmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'play in the Mansarda'
      turn_on:
        service: media_player.media_play
        data:
          entity_id: media_player.skyq_mansarda
      turn_off:
        service: script.placeholder
    skyq_ffmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'fastforward in the Mansarda'
      turn_on:
        service: media_player.media_next_track
        data:
          entity_id: media_player.skyq_mansarda
      turn_off:
        service: script.placeholder
    skyq_rwmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'rewind in the Mansarda'
      turn_on:
        service: media_player.media_previous_track
        data:
          entity_id: media_player.skyq_mansarda
      turn_off:
        service: script.placeholder
    skyq_skytg24mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyTg24 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyTg24'
      turn_off:
        service: script.placeholder
    skyq_foxmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Fox in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Fox'
      turn_off:
        service: script.placeholder
    skyq_rai1mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Rai1 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Rai1'
      turn_off:
        service: script.placeholder
    skyq_rai2mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Rai2 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Rai2'
      turn_off:
        service: script.placeholder
    skyq_rai3mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Rai3 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Rai3'
      turn_off:
        service: script.placeholder
    skyq_rete4mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Rete4 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Rete4'
      turn_off:
        service: script.placeholder
    skyq_canale5mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Canale5 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Canale5'
      turn_off:
        service: script.placeholder
    skyq_italia1mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Italia1 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Italia1'
      turn_off:
        service: script.placeholder
    skyq_la7mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'La7 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'La7'
      turn_off:
        service: script.placeholder
    skyq_skycinema1mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinema1 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinema1'
      turn_off:
        service: script.placeholder
    skyq_skycinema2mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinema2 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinema2'
      turn_off:
        service: script.placeholder
    skyq_skycinemacollectionmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinemaCollection in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinemaCollection'
      turn_off:
        service: script.placeholder
    skyq_skycinemafamilymansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinemaFamily in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinemaFamily'
      turn_off:
        service: script.placeholder
    skyq_skycinemaactionmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinemaAction in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinemaAction'
      turn_off:
        service: script.placeholder
    skyq_skycinemasuspencemansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinemaSuspence in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinemaSuspence'
      turn_off:
        service: script.placeholder
    skyq_skycinemaromancemansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinemaRomance in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinemaRomance'
      turn_off:
        service: script.placeholder
    skyq_skycinemadramamansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinemaDrama in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinemaDrama'
      turn_off:
        service: script.placeholder
    skyq_skycinemacomedymansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinemaComedy in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinemaComedy'
      turn_off:
        service: script.placeholder
    skyq_skycinema1+24mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinema1+24 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinema1+24'
      turn_off:
        service: script.placeholder
    skyq_skycinema2+24mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyCinema2+24 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyCinema2+24'
      turn_off:
        service: script.placeholder
    skyq_premiumcinemamansarda:
      value_template: '{{"off"}}'
      friendly_name: 'PremiumCinema in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'PremiumCinema'
      turn_off:
        service: script.placeholder
    skyq_premiumcinema+24mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'PremiumCinema+24 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'PremiumCinema+24'
      turn_off:
        service: script.placeholder
    skyq_premiumcinemaenergymansarda:
      value_template: '{{"off"}}'
      friendly_name: 'PremiumCinemaEnergy in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'PremiumCinemaEnergy'
      turn_off:
        service: script.placeholder
    skyq_premiumcinemaemotionmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'PremiumCinemaEmotion in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'PremiumCinemaEmotion'
      turn_off:
        service: script.placeholder
    skyq_premiumcinemacomedymansarda:
      value_template: '{{"off"}}'
      friendly_name: 'PremiumCinemaComedy in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'PremiumCinemaComedy'
      turn_off:
        service: script.placeholder
    skyq_irismansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Iris in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Iris'
      turn_off:
        service: script.placeholder
    skyq_skyartemansarda:
      value_template: '{{"off"}}'
      friendly_name: 'SkyArte in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'SkyArte'
      turn_off:
        service: script.placeholder
    skyq_discoverychannelmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'DiscoveryChannel in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'DiscoveryChannel'
      turn_off:
        service: script.placeholder
    skyq_discovery+1mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'Discovery+1 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'Discovery+1'
      turn_off:
        service: script.placeholder
    skyq_natgeomansarda:
      value_template: '{{"off"}}'
      friendly_name: 'NatGeo in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'NatGeo'
      turn_off:
        service: script.placeholder
    skyq_natgeo+1mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'NatGeo+1 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'NatGeo+1'
      turn_off:
        service: script.placeholder
    skyq_discoverysciencemansarda:
      value_template: '{{"off"}}'
      friendly_name: 'DiscoveryScience in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'DiscoveryScience'
      turn_off:
        service: script.placeholder
    skyq_historychannelmansarda:
      value_template: '{{"off"}}'
      friendly_name: 'HistoryChannel in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'HistoryChannel'
      turn_off:
        service: script.placeholder
    skyq_history+1mansarda:
      value_template: '{{"off"}}'
      friendly_name: 'History+1 in the Mansarda'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_mansarda
          source: 'History+1'
      turn_off:
        service: script.placeholder

Is it valid?

AHAHAHAH, i solved :smiley:
The room was called Mansarda, so the file was skyqMansarda and not skyqmansarda.
Btw it seems that the char + is not allowed for switches so i will change it

1 Like

What about icon dimensions? I’m tryng to make a remote with buttons for every channel with the correct icon, but i can’t find the right dimension for the image. This is with 600x600 png file, i can’t understand why the same dimension image looks different on buttons…
image

I’ve changed the dimension of the “Skycinemaaction” image, now it’s not squared, 200x23 and on pc looks like this:
image

On android app looks like this:

This is the code:

cards:
artwork: cover
background: /local/Sky.png
entity: media_player.skyq_mansarda
hide: ‘volume:true source:true power_state:false’
name: Sky Q Platinum Mansarda
shortcuts:
buttons:
- icon: ‘mdi:arrow-up-box’
id: CHup
name: CH+
type: source
- icon: ‘mdi:arrow-down-box’
id: CHdn
name: CH-
type: source
- id: Sky
image: /local/Sky.png
type: source
- icon: ‘mdi:home-outline’
id: Home
type: source
- icon: ‘mdi:exit-to-app’
id: Dismiss
type: source
- icon: ‘mdi:keyboard-return’
id: Select
type: source
- icon: ‘mdi:arrow-up-thick’
id: Up
type: source
- icon: ‘mdi:arrow-down-thick’
id: Down
type: source
- icon: ‘mdi:arrow-left-thick’
id: Left
type: source
- columns: 1
hide_when_off: true
icon: ‘mdi:arrow-right-thick’
id: Right
type: source
- id: skycinema1
image: /local/Skycinema.png
type: source
- id: skycinema2
image: /local/Skycinema.png
type: source
- id: skycinemaaction
image: /local/Skyaction.png
type: source
- id: skycollection
image: null
type: source
type: ‘custom:mini-media-player’
type: vertical-stack

Hi,

Updated to latest Home Assistant build today. 0.104.0

SkyQ Media Player seems to have lost cover art and the programme playing information is gone.
It might be a conincidence and something else might be the cause.
How can I trouble-shoot.

Also I use the SkyQ player with a universal player normally so it can control AVR volume.
The cover art didn’t carry through the univeral player even when it was working.
Is this a bug?

Thanks,
Bruce.