Home_Assistant_SkyQ_MediaPlayer: [BUG] Doesn't tolerate a restart of Home Assistant when the Sky Q is in Eco Mode
Describe the bug
Doesn’t tolerate a restart of Home Assistant when the Sky Q is in Eco Mode, I have any automation that restarts Home Assistant at 4am each day, mainly because I have an issue with a different integration that the dev has ignored, 4am because its dark and very little runs overnight.
I am in the UK using Sky Q - UK.
To Reproduce
Steps to reproduce the behavior:
- Allow the boxes to go into Eco Mode overnight
- Restart Home Assistant when Sky Q is in Eco Mode
Expected behavior
To wait or poll until eco mode has ended and then reattampt to establish communication without throwing an error into the log.
Screenshots

Component versions
V2.9.2
Your configuration
How have you setup your devices, by UI or YAML?
UI Setup
Output of HA logs
Paste the relavant output of the HA log here.
Logger: homeassistant.config_entries
Source: custom_components/skyq/__init__.py:44
Integration: Sky Q (documentation, issues)
First occurred: 04:05:49 (2 occurrences)
Last logged: 04:05:49
Error setting up entry Top's Bedroom Sky Q Mini for skyq
Error setting up entry Top's Gaff Sky Q for skyq
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/skyq/__init__.py", line 44, in async_setup_entry
remote = await hass.async_add_executor_job(SkyQRemote, host, epg_cache_len)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/pyskyqremote/skyq_remote.py", line 60, in __init__
self._setup_remote()
File "/usr/local/lib/python3.9/site-packages/pyskyqremote/skyq_remote.py", line 332, in _setup_remote
device_info = self.get_device_information()
File "/usr/local/lib/python3.9/site-packages/pyskyqremote/skyq_remote.py", line 287, in get_device_information
self._remote_config.set_device_info(device_info)
File "/usr/local/lib/python3.9/site-packages/pyskyqremote/skyq_remote.py", line 378, in set_device_info
self.territory = TERRITORIES[device_info.used_country_code]
AttributeError: 'NoneType' object has no attribute 'used_country_code'
Additional context
Great integration by the way, not knocking it at all.
Working around the issue is by way of restart of HA or delete and reinstalling the integration or disabling and then reenabling the entity. It seems the integration doesn’t repoll for the Sky Q devices after they come back up.
Reloading the integration from the UI might help, but that option isn’t in the list.
The Sky Q comes out of eco around 05:45hrs each day.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 46 (27 by maintainers)
Commits related to this issue
- Fix issue with restart during eco mode https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/issues/106 — committed to RogerSelwyn/skyq_remote by RogerSelwyn 5 years ago
- Bump pyskyqremote to 0.3.12 https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/issues/106 — committed to RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer by RogerSelwyn 5 years ago
Initial bug fixed with https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/releases/tag/v2.9.4. If a new bug is identified please post a separate issue. Closing this one.
Should be fixed with - https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/releases/tag/v2.9.3