Custom Component: SkyQ Media Player

The skyq platform allows you to control a SkyQ set top box.

There is currently support for the following device types within Home Assistant:

  • Media Player

Media Player

To begin with ensure your SkyQ set top box or boxes have static IP addresses.

Download the custom component into your <home assistant config folder>\custom_components\skyq\

Download Link

CONFIGURATION

To add a SkyQ to your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry

media_player:

- platform: skyq

CONFIGURATION VARIABLES

host

(string)(Required)

The IP of the SkyQ set top box, e.g., 192.168.0.10.

name

(string)( Required)

The name you would like to give to the SkyQ set top box.

sources

(list)( Required)

List of channels or other commands that will appear in the source selection.

room

(string)( Required)

The room where the SkyQ set top box is located.

 

config_directory

(string)( Required)

The location of your default configuration folder.

Hassbian default would be - config_directory: '/home/homeassistant/.homeassistant/'

generate_switches_for_channels

(boolean)( Required)

Generate switches for each item listed in source, this helps when using an assistant e.g google home

Usage based on google home: “turn on <source name / channel name> in the <room>”

To integrate these, add the generated yaml, to your configuration.yaml

EXAMPLE

switch:

- platform: template

    switches: !include skyq<room*>.yaml

*remove any spaces from the room

EXAMPLE

A full configuration example will look like the sample below:

# Example configuration.yaml entry

media_player:

- platform: skyq

    name: SkyQ Living Room

    host: 192.168.0.10

    room: Living Room

    config_directory: '/home/homeassistant/.homeassistant/'

    generate_switches_for_channels: true

    sources:

      SkyOne: '1,0,6'

      SkyNews: '5,0,1'

Avoid using [ ] in the name: or room: of your device.

SOURCES

To configure sources, set the name as <name>: ‘<button>,<button>,<button>’.

Supported buttons:

sky, power, tvguide or home, boxoffice, search, sidebar, up, down, left, right, select, channelup, channeldown, i, dismiss, text, help,

play, pause, rewind, fastforward, stop, record

red, green, yellow, blue

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

NEXT/PREVIOUS BUTTONS

The behaviour of the next and previous buttons is fastforward and rewind (multiple presses to increase speed, play to resume)

 

 

9 Likes

Hello and many thanks, outstanding, it works perfecly.
One question: do you have any example of skyq_remote control under lovelace?
Thanks again!!!

Thanks @IK0ADR

I’ve only been using HA for a couple of weeks, so lovelace is new… had a quick look at the development side and it looks achievable to generate a lovelace card in a similar way to the switch generation.

@cameron are you able to share your yaml for this ?, it would help as a starting point :slight_smile: - Sky Q box switch

Great! Thanks!
Some notes:

  • It’s possible to send command via inputbox? Example: change channel number via input_text
    It can be usefull to integrate in google home via ifttt and appdaemon
  • On a previous integration was possible to see the channel name or the streamed content in the mediaplayer, probably the data is still available from the skyQ. Example: ‘Reproducing: SkyNews’

Hi @Fraschi, unfortunatly, at least at the moment the current channel being viewed isnt available from the box… however, i can add the current channel playing based on the channel you select via home assistant, but this would go out of sync if the remote is used.

I’ll look into the input text, but looking the only way this would be achievable from an assistant via the media player component, i think, would be to use the set volume command. - this could then be extended with input text, i think

Thanks for your feedback, always welcomed :slight_smile:

1 Like

@4n0nD3v3l0p3r Should this work on Hass.io? I’m a HA newbie anyway so am still struggling to work it all out but I think the file locations are different and in the sky_remote.py file I can see a line that seems to hard code the file location (Line 5 ROOT = “/home/homeassistant/.homeassistant/”) , so I’m not sure it is even possible.

If it should work on Hass,io I’d be grateful for any handholding available to set this up. Thanks

1 Like

How to use the source switches in an automation?

Same here, just discovered this but I’m still a newbie when it comes to custom components…

Use the binary switches the component creates.

generate_switches_for_channels

(boolean)( Required)

Generate switches for each item listed in source, this helps when using an assistant e.g google home

Usage based on google home: “turn on <source name / channel name> in the ”

To integrate these, add the generated yaml, to your configuration.yaml

EXAMPLE

switch:

- platform: template

  switches: !include skyq<room*>.yaml

*remove any spaces from the room

Thanks, i got it… What do you mean in the docs about the buttons? How to create buttons with, for example, sky or power or the other available features?
EDIT: i cannot find any binary sensor created also if i follow your docs.
My config is:

  - platform: skyq
    name: SkyQ Salotto
    host: 192.168.1.32
    room: salotto
    config_directory: '/home/homeassistant/.homeassistant/'
    generate_switches_for_channels: true
    sources:
      SkyUno: '1,1,0'
      SkyTG24: '5,0,0'
      SkySport_Serie_A: '2,0,2'
      Inter_TV: '2,3,2'

I wasn’t able to use that.
We should call the author for help… :grin:

Still trying to get the binary switches created with this component…
Where the hell they are? And which is their name?

My config is:

  - platform: skyq
    name: SkyQ Salotto
    host: 192.168.1.32
    room: salotto
    config_directory: '/home/homeassistant/.homeassistant/'
    generate_switches_for_channels: true
    sources:
      SkyUno: '1,1,0'
      SkyTG24: '5,0,0'
      SkySport_Serie_A: '2,0,2'
      Inter_TV: '2,3,2'

They are created in your config directory.
Filename is skyqsalotto.yaml for your salotto room.
In your config file, in the switch section, you should include

switch:

  - platform: template
    switches: !include skyqsalotto.yaml

Ok, finally i found them :smile:!
Are they configurable inside that yaml? I mean the name…

The system automatically gives the switch name with channel name and room.

    skyq_sky_sport_trelivingroom:
      value_template: '{{"off"}}'
      friendly_name: 'Sky_Sport_Tre in the Living Room'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.skyq_living_room
          source: 'Sky_Sport_Tre'
      turn_off:
        service: script.placeholder

My room is named “Living Room” of course.
The switch name is

switch.skyq_sky_sport_trelivingroom

If you change something it will be overwritten the next HA start.

So i can change the friendly name and/or the switch name?
If it is created as

skyq_sky_sport_trelivingroom

may i change it into

skyq_sky_sport_tre ?

EDIT: To add more channels i do it in the media_player configuration or inside this yaml?

Yes, of course, but it would be overwritten with the old name on HA start.
OR you may disable the file creation, thus saving the changes.
Your choice…

generate_switches_for_channels: false

So if i add more names inside this yaml i don’t need to add also to the media_player config?
Ah, ok i understand now… And if i use false, i will have the names i add to the yaml when clicking on the arrow in the media player card?

Don’t need to add anything.
The yaml files created will not be deleted with ‘false’.

1 Like

Ok, thanks…