Custom Component: SkyQ Media Player

I try to modify component to take Channel Images for the Italian SkyQ box.
Url now is:

CLOUDFRONT_IMAGE_URL_BASE = "http://ethaneurope.it.imageservice.sky.com/pd-logo/skychb_{0}{1}/389/80"

“389/80” is the size of image.
{0} is the SID
{1} is the channel name without symbols like this:

chid=''.join(e for e in channelNode["t"].lower() if e.isalnum())
..........
{"imageUrl": CLOUDFRONT_IMAGE_URL_BASE.format(sid,chid)}

We can take image also from “https://guidatv.sky.it/pd-logo/skychb_{sid}{chid}?tr=n-logo_80

I’m unable to fit image in my MiniPlayer but now is only exercise.

I also try to get the EPG url by sniff but i find only a link where are categories for the EPG grid with link to "“uri”: “tvguide://grid?genre=FAV”
For italian epg i try to work on “https://guidatv.sky.it/

I’ll take a look

Great, thanks…
I noticed inside the HACS component i don’t see anymore the file sky_remote.py…
Is it correct?
EDIT, i just read the release notes so i am asking if we must install pyskyremote and we with hassio how to install it?

Yes, it is now installed from PyPI

Hmmm don’t understand… what must i do to use the 2.0 release with HA 0.107.7?
After installing with HACS do i need only a restart ?

I looked at similar images before. The problem with them is that they are the logos designed to go in bottom left of channel, so they are filled with white space. If you know how to easily crop them to take out the whitespace, they could be used. Generating the url is fairly easy, I’ve done most of that work already, but the image will just appear at bottom left of the player.

600

Yes, it should have prompted you to restart. No configuration change required.

Unfortunately they are the only images used. Also on guidasky.
But these are transparent PNG no chance to fit on card?

I’m afraid I don’t handle how it is presented in the card, that is done by the Lovelace cards. It would all need to be done in the url, and I don’t know of a way to crop via url.

I have written the code to provide the correct url, which I’ll probably release, then you can add an extra parameter ‘country’ to your config, but the image will show at bottom left (I think) without the blue background (which I added).

Ok for IT EPG i forge this URL (Channel: FOX HD)

https://apid.sky.it/gtv/v1/events?to=2020-04-13T19:31:10Z&pageSize=1&pageNum=1&from=2020-04-13T13:28:06Z&env=DTH&channels=9077

Date are generated from this python

(datetime.now() + timedelta(hours=3)).strftime("%Y-%m-%dT%H:%M:%SZ") #to
(datetime.now() - timedelta(hours=3)).strftime("%Y-%m-%dT%H:%M:%SZ") #from

Channels ID can be found to (by LCN number):

https://apid.sky.it/gtv/v1/channels?env=DTH
Added entity icon to show Live/Recording/Application/Off

Where i get those icons? Or how to show them inside the card?
I am actually viewing a movie but what i can see is:

Schermata 2020-04-13 alle 16.49.27

You’ve overridden the icon somewhere. Either in Lovelace or in customise.yaml

1 Like

Take the remote icon off the Lovelace card and you’ll see the ones Roger set.
You’ve over-riden it on yours to show a remote control in the top left.

I’ll see if I can figure this and make the code generic enough

Thanks @RogTP and @Coedy… solved!

I’m hopeful. Putting the current UTC time in that url, and set pagenum=0 will provide the current programme. But I don’t have that channel number from the calls to the box, so would need to look it up at that other url. I’ll see what can be done, but got to go back to work tomorrow, bank holiday over and curry to cook tonight.

https://apid.sky.it/gtv/v1/events?from=2020-04-13T15:53:00Z&to=2020-04-14T15:53:00Z&pageSize=1&pageNum=0&env=DTH&channels=9034

From “/as/services” in IT i have “c” for LCN. You can retrieve this number on:

https://apid.sky.it/gtv/v1/channels?env=DTH

If you need help PM me

I have already PM’d you :slight_smile:

Good job, everything works fine
Thank you

1 Like

I have just release a new version (v2.1.2) of the SkyQ component. The major change is support for Italy.

This release includes an updated version of pyskyqremote which adds support for countries other than the UK. At the moment the only added country is Italy, where support for live programmes and programme images has been added.

To utilise the Italy information add the following to your configuration.yaml for the skyq media player. Also ensure that ‘live_tv’ is removed or set to True.

country: "IT"
2 Likes