Custom Component: SkyQ Media Player

I don’t have it yet. But it’s a raspberry pi zero inside a custom case running a custom linux build and software. It’s developer has included some native functionality, but it also links into Homey and Home Assistant among others. take a look at https://www.yio-remote.com/

I can’t buy it anymore it seems :frowning:

I’ve just released version 2.1.8. This version adds support to remove a couple of deprecation warning that HA 0.110.0 will show. Also aligning further with HA standards to enable better integration with the Integration changes HA is introducing - mostly invisible to installers. Additionally the component now shows when the SkyQ box is unavailable (switched off/sleeping). Plus various bug fixes and stability improvements introduced in the pyskyqremote library.

I’m moving towards adding a GUI based configuration flow, but I’m very conscious about the separate debate on the use of YAML, so it is my intent to continue the support of YAML if at all possible. But for integrations to fully support the way HA is moving I need to add the GUI based support

3 Likes

Can confirm the config flow works perfectly, if you do not remove the yaml config and then add the same ip address it also copies the config across. Not managed to use the custom configs yet but the option to add channels seems good. One thing I will say is maybe channel numbers in front of the channel name as I rarely know where they reside between other channels I do not use.

Two things… Firstly the code is alpha, so is very likely to change or not work. Be prepared for instability… Secondly, I better check how the point on YAML is working, because I’ve just allowed the use of both for separate Sky boxes, not that you can add an existing item via the config flow.

I have added this in the config flow options, but not in the source list on the entity.

1 Like

Hi Roger
I’ve upgraded to the 2.2.0 Alpha 2 and the component works fine as usual :+1: but I can’t get the config flow to work at all.
If I go to Integrations and look to add it I get the “installing component” message but then just back to Integrations without it installing…the yaml configured entities work fine .

Let me know if there is anything else I can send you to help if this is an issue…or if you want me to open an issue on GitHub for it (or is it the same as issue #5 on there already?)

Also in case it’s relevant…with the 2.2.0 upgrade (I think it was then anyway) all of my entities got recreated as “_2” with the original ones going unavailable, so maybe there is something there :thinking:

Really I haven’t planned for recreating the same entities via config flow, which is probably why you have duplicates, but I’ll take a look. Have a look logs for errors and post an issue here - https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/issues

1 Like

will do
just to say though, don’t have duplicate entities per se…
When I upgraded to the first alpha (not Alpha 2) it seems that the entities got recreated as _2 using the original yaml config with the original entities now unavailable…didn’t touch the config flow side of things.
anyway will open issue as per your msg…cheers :+1:

edit - issue #6 opened

As I commented earlier, I’m surprised this actually worked for you. In my testing, if you go from v2.1.8 to v2.2.0.alpha2, then add a box that you had in yaml via the config flow, then you should get an error in the logs at that point and at every startup, something like:

ERROR (MainThread) [homeassistant.components.media_player] Entity id already exists - ignoring: media_player.sky_q. Platform skyq does not generate unique IDs

This is because each entity has a unique ID (country code and serial number in Sky Q’s case), and both YAML and config_flow use the same method to generate the ID. So when the entities are started up, if there are two with the same unique ID, you will get this error.

Probably worth checking your logs :slight_smile:

As I said above (I think), I’m unlikely to support copying config across, or overriding config_flow with YAML. One or the other for each entity is my target.

Hi Roger, everything’s fine and working like a charm, but how to avoid log like this:

  • Template switch ‘skyq_sidebarroom’ has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.

Thanks a lot

That isn’t an issue with skyq by the look of it. I would guess your entity ‘switch.skyq_sidebarroom’ is trying to extract date from a media_player entity and the media_player entity has changed name or something?

Can you provide details of the configuration of the template switch?

1 Like

I’ve just release v2.2.0. The primary change in this release is the ability to add devices/entities via the UI. This doesn’t change the support for YAML configuration (apart from that it is no longer mandatory to supply ‘Sources’ in YAML).

As noted in the readme, there is no migration of existing configurations into the UI based setup. Also please don’t configure the same box via YAML and via UI, you will just end up with errors or duplicates.

The UI based configuration provides the additional benefit of providing a list of channels you can select as sources for the standard sources dropdown on Lovelace. So both ‘custom’ sources and ‘channel’ sources are populated into the dropdown. The reason for both is that I know people use the old (custom) sources for things like Netflix which of course aren’t available in the list of channels.

Input into the custom sources is similar but different to the YAML method. YAML would look like:

sources:
  BBC1: "1,0,1"
  BBC2: "1,0,2"

For the UI, this needs changing to JSON as below:

{"BBC1": "1,0,1", "BBC2": "1,0,2"}

The UI validates the commands against the valid list as shown on Github, so you can do things like “home,down,down,1”.

This is a really major change to the code base, so I apologise for any bugs in advance. I’ve been testing for some days as I know others have, so hopefully the worst of them should be gone.

I am little lost now, what is the difference between Sources and Channels.

I commented out my sources to try and understand, but now it’s just blank and I can’t change channels via the dropdown (well the drop down is now entirely missing).

Edit: Ah ignore, just re-read and channels is only when added via the GUI.

Yep. Channels just via UI :slight_smile:

Hi Roger,

I’ve updated to 2.2.0, I’ve set up everything via integration UI and just added this to configuration.yaml:

switch more:
- platform: template
  switches: !include skyqDefaultRoom.yaml

And this is my generated skyqDefaultRoom.yaml

    skyq_pausedefaultroom:
      value_template: '{{"off"}}'
      friendly_name: 'pause in the Default Room'
      turn_on:
        service: media_player.media_pause
        data:
          entity_id: media_player.sky_q
      turn_off:
        service: script.placeholder
    skyq_playdefaultroom:
      value_template: '{{"off"}}'
      friendly_name: 'play in the Default Room'
      turn_on:
        service: media_player.media_play
        data:
          entity_id: media_player.sky_q
      turn_off:
        service: script.placeholder
    skyq_ffdefaultroom:
      value_template: '{{"off"}}'
      friendly_name: 'fastforward in the Default Room'
      turn_on:
        service: media_player.media_next_track
        data:
          entity_id: media_player.sky_q
      turn_off:
        service: script.placeholder
    skyq_rwdefaultroom:
      value_template: '{{"off"}}'
      friendly_name: 'rewind in the Default Room'
      turn_on:
        service: media_player.media_previous_track
        data:
          entity_id: media_player.sky_q
      turn_off:
        service: script.placeholder
    skyq_skytg24hddefaultroom:
      value_template: '{{"off"}}'
      friendly_name: 'Sky TG24 HD in the Default Room'
      turn_on:
        service: media_player.select_source
        data:
          entity_id: media_player.sky_q

This the Lovelace card:

type: media-control
entity: media_player.skyq

What I get from the log is:

Template switch 'skyq_pausedefaultroom' has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.
Template switch 'skyq_playdefaultroom' has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.
Template switch 'skyq_ffdefaultroom' has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.
Template switch 'skyq_rwdefaultroom' has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.

Anyway everything’s working fine.

Thank you

Running 0.110.4 with skyq 2.21 and i got these errors:

2020-06-03 20:42:44 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration skyq: cannot import name 'CONF_CHANNEL_SOURCES' from 'custom_components.skyq.const' (/config/custom_components/skyq/const.py)

I was trying to add UI integration…

Please provide the full error stack by clicking ‘Load Full Home Assistant Log’.

Also, did you restart Home Assistant after updating SkyQ?

Maybe my fault but still do not understand how to use the UI integration. Before all I must delete the entire yaml configuration and then add the UI? Or I must disable only the ‘sources’ part of the yaml configuration and then add the UI? I installed 2.21 but forgot to restart HA. Now before restarting what to do?
Sorry if they are stupid questions…

Please re-read this.

Also here - GitHub - RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer: Home Assistant SkyQ Media player component

Depending on which version of HACS you are using it will have either reminded you before upgrading, or given a prompt after upgrading that you need to restart HA. If you don’t want to use the UI you don’t have to, it will still work after the upgrade and reboot.