bertbert72 / HomeAssistant_VirginTivo

HomeAssistant component for control of Virgin Media Tivo boxes
GNU General Public License v3.0
29 stars 22 forks source link

Suddenly stopped working with errors thrown. Entity no longer added. #66

Closed lanerobertlane closed 3 years ago

lanerobertlane commented 3 years ago

Has stopped working for me. Had to reboot HA recently and since then I'm just getting the following errors. I've not manually changed anything about the set up since it was working.

Error doing job: Task exception was never retrieved 17:19:48 – custom_components/virgintivo/media_player.py (ERROR)

Error adding entities for domain media_player with platform virgintivo 17:19:28 – Media Player (ERROR)

Virgin V6: incorrect channel configuration for channel [748] 17:19:24 – virgintivo (WARNING)

No channel configuration available 17:19:22 – virgintivo (ERROR)

Heres the full error log: 2021-02-01 17:19:22 ERROR (SyncWorker_0) [custom_components.virgintivo.media_player] No channel configuration available 2021-02-01 17:19:24 WARNING (SyncWorker_3) [custom_components.virgintivo.media_player] Virgin V6: incorrect channel configuration for channel [748] 2021-02-01 17:19:28 ERROR (MainThread) [homeassistant.components.media_player] Error adding entities for domain media_player with platform virgintivo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities await asyncio.gather(tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File "/config/custom_components/virgintivo/media_player.py", line 804, in device_state_attributes 'base_channel_name': self._channels[self.get_sd_channel(self._channel_id)][CONF_NAME], KeyError: None 2021-02-01 17:19:32 WARNING (MainThread) [homeassistant.components.switch] Setup of switch platform tapo_p100_control is taking over 10 seconds. 2021-02-01 17:19:48 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities await asyncio.gather(tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File "/config/custom_components/virgintivo/media_player.py", line 804, in device_state_attributes 'base_channel_name': self._channels[self.get_sd_channel(self._channel_id)][CONF_NAME], KeyError: None

robertwigley commented 3 years ago

I am having the same issue. In the last few hours, the entity has disappeared from my configuration. No change to the Virgin TiVo setup. Details from my log:

2021-02-01 18:36:14 ERROR (SyncWorker_7) [custom_components.virgintivo.media_player] No channel configuration available 2021-02-01 18:36:20 ERROR (MainThread) [homeassistant.components.media_player] Error adding entities for domain media_player with platform virgintivo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File "/config/custom_components/virgintivo/media_player.py", line 804, in device_state_attributes 'base_channel_name': self._channels[self.get_sd_channel(self._channel_id)][CONF_NAME], KeyError: None

2021-02-01 18:36:29 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File "/config/custom_components/virgintivo/media_player.py", line 804, in device_state_attributes 'base_channel_name': self._channels[self.get_sd_channel(self._channel_id)][CONF_NAME], KeyError: None

badguy99 commented 3 years ago

Looks like https://www.tvchannellists.com/List_of_channels_on_Virgin_Media_(UK) has gone, not sure what is going on, but https://www.tvchannellists.com/ just has a hosting holding page.

badguy99 commented 3 years ago

I don't know if it will help or not, or how much things have changed, but the way back machine has an old copy - https://web.archive.org/web/20180810175806/https://www.tvchannellists.com/List_of_channels_on_Virgin_Media_(UK)

MightyWomble2020 commented 3 years ago

I have exactly the same problem. I tried changing the channel list URL in media_player.py but I still don't have an entities. Is there anyway to prevent trying to lookup the channel lists at all?

bertbert72 commented 3 years ago

If you turn off the channel lists, you need to manually enter all the channels. See example2.yaml for how to do this. The list of channels in the example is out of date though.

Don't know why the site is down or whether this is temporary or permanent. You can point to the Google cache in the meantime.

https://webcache.googleusercontent.com/search?q=cache:GSD0JkcvtBgJ:https://www.tvchannellists.com/List_of_channels_on_Virgin_Media_(UK)+&cd=16&hl=en&ct=clnk&gl=uk

That's up to date as of yesterday so should work fine for the moment. If this turns out to be permanent, I'll need to think of something else.

badguy99 commented 3 years ago

Looks like they are having some server issues. There is some info at the bottom of https://staging.tvchannellists.com/User_talk:Tvchannellists Also the channel listings are available here: https://staging.tvchannellists.com/List_of_channels_on_Virgin_Media_(UK)

lanerobertlane commented 3 years ago

Would it be a tonne of trouble to maintain our own list we could point too? Something like https://raw.githubusercontent.com/lanerobertlane/Virgin_tivo_channel_list/main/channel_list.csv https://github.com/lanerobertlane/Virgin_tivo_channel_list/blob/main/channel_list.csv

That way it's updatable via the community when there are line up changes, and it's not reliant on a site to be up?

robertwigley commented 3 years ago

The website is back online. A quick restart of Home Assistant and the entity has reappeared and is now working again.

I wonder if it's possible to change the integration so that if this happens again it automatically reverts to running without the channel list, rather than not loading at all?

bertbert72 commented 3 years ago

New version up that creates a cache when it successfully loads the channel list. Then if the site does go offline, it will load the last cached copy.