Skip to content

bertbert72/HomeAssistant_VirginTivo

Repository files navigation

Home Assistant VirginTivo

Home Assistant component for control of Virgin Media Tivo boxes

Virgin Tivo component for Home Assistant Source list

Features are

  • Supports multiple boxes
  • Configurable list of channels (see /resources for a tool to help)
  • Optionally update list of channels automatically from TV Channel Lists
  • Automatically switch to HD version of channel
  • Show current channel
  • Set channel through dropdown
  • Can restrict channels shown in dropdown
  • Switch between +1 and normal version of channel
  • Depending on whether the channel is available on Virgin Go
    • Display programme information
    • Display grab of current programme
  • Optionally use Tivo remote to control other media player devices (obscure I know!)
  • Services: find remote, send IR code, send keyboard command, last channel, live TV, switch to/from +1 channel, search for programme, subtitles on/off, "teleport".
  • Supports automated component updating via custom_updater (https://custom-components.github.io/custom_updater/)

A sample configuration is in the repository with a full list of Virgin Media channels. Note that a channel scraper has been added in /resources to get the latest channels in a compatible format from https://www.tvchannellists.com.

Alexa automation hints are provided in the automations/alexa folder by garywilson4.

Usage

  • Create a folder called custom_components/virgintivo.
  • Drop both the media_player.py and manifest.json files into the custom_components/virgintivo directory.
  • Edit your configuration file to add the virgintivo platform to the media_player: section.

Note: Ensure you have enabled Network Remote Control on your Tivo box

Configuration

There is one required section: tivos, plus two sections of which at least one is required: tvchannellists and channels, plus one optional section: guide.

Platform settings are:

Name Default Description Example
platform (req) Must be virgintivo virgintivo
default_is_show (opt) true Channels default to shown/hidden true
force_hd (opt) false Switch to HD if available false
keep_connected (opt) false Persistent telnet connection to Tivo false
show_packages (opt) TV packages to show Free-to-air,Player,Mix,Fun,Full House

NB:

  1. If using the force_hd functionality, it is advisable to set scan_interval to a low value, e.g. 1 to allow the component to change to the HD channel quickly.
  2. To temporarily suspend the HD switching function, switch back to the SD channel within a few seconds of the automatic change. It won't change to the HD version again until you move away from the channel.

tivos

The Tivos should be listed under the tivos: section. Each entry has two required settings and one optional.

Name Default Description Example
name (req) Friendy name of Tivo box Virgin Tivo
host (req) IP or name of Tivo box TIVO-C68000012345678
force_hd (opt) false Switch to HD if available false
keep_connected (opt) false Persistent telnet connection to Tivo false

tvchannellists

This allows automatic updating of the channel lists from the GitHub repository. Overrides are available to customise the list as required.

NB: If both tvchannellists and channels are configured, the site will be tried first and if this fails the local channel configuration will be used.

Name Default Description Example
enable (req) Enable this functionality True
region (opt) E Channel region: E(ngland), S(cotland), W(ales), N(orthern Ireland) N
url (opt)1 URL for channel listing
ignore_channels (opt) Ignore these channels from the site 0
show_channels (opt) Show the channel in the sources list 101,102,103,104
hide_channels (opt) Hide the channel in the sources list 990,991,992,993
logos (opt) Channel logo to display
101: https://www.mysite.uk/images/bbcone.png
targets (opt) HA entity to change
901: media_player.family_room
sources (opt) Source on target to choose
901: Virgin V6
override (opt) Override for a channel
override:
101:
name: BBC One
package: Player
is_hd: False

1 The built-in URL used is currently https://www.tvchannellists.com/List_of_channels_on_Virgin_Media_(UK). It is not recommended to change this as the component is unlikely to understand a different site.

channels

Channels come under the channels: section. Each entry has a number of optional settings and one required setting (name). Use next/previous track to switch between the +1 and normal versions of a channel.

Name Default Description Example
name (req) Friendy name of channel BBC One
show (opt) Show the channel in the sources list false
package (opt) TV package Mix
hd_channel (opt) HD channel number if applicable 108
plus_one (opt) +1 channel number if applicable 114
logo (opt) Channel logo to display http://freeview.com/images/e4.png
target (opt) HA entity to change media_player.main_tv
source (opt) Source on target to choose HDMI2

guide

The guide settings come under the guide: section. This section has a number of optional settings.

Name Default Description Example
enable_guide (opt) true Enable the guide functionality false
cache_hours (opt) 12 How many hours of the guide to preload 12
picture_refresh (opt) 60 Seconds between screen updates 60

Services

These can be called by automations, scripts etc.

Service Entity Description Example Data
Find Remote 1 media_player.virgintivo_find_remote Causes the remote to beep {"entity_id": "media_player.virgin_v6"}
Send IR Code media_player.virgintivo_ircode Sends an IR command {"entity_id": "media_player.virgin_v6", "command": "standby"}
{"entity_id": "media_player.virgin_v6", "command": "advance", "repeats": 10}
Send Keyboard Command media_player.virgintivo_keyboard Sends a key entry {"entity_id": "media_player.virgin_v6", "command": "A"}
Live TV media_player.virgintivo_live_tv Switch to normal TV mode {"entity_id": "media_player.virgin_v6"}
Plus One Off media_player.virgintivo_plus_one_off Switch to non +1 version of channel {"entity_id": "media_player.virgin_v6"}
Plus One On media_player.virgintivo_plus_one_on Switch to +1 version if available {"entity_id": "media_player.virgin_v6"}
Search media_player.virgintivo_search Search for a programme {"entity_id": "media_player.virgin_v6", "command": "family guy"}
Subtitles Off media_player.virgintivo_subtitles_off Turn off subtitles {"entity_id": "media_player.virgin_v6"}
Subtitles On media_player.virgintivo_subtitles_on Turn on subtitles {"entity_id": "media_player.virgin_v6"}
Teleport 2 media_player.virgintivo_teleport Change mode {"entity_id": "media_player.virgin_v6", "command": "livetv"}

1 Works with the Virgin V6 Bluetooth remote

2 This forces the Tivo into certain modes. Known available entries are: TIVO, LIVETV, GUIDE, NOWPLAYING

Custom_Updater (Depricated)

The component can be kept up-to-date using the optional custom_updater integration. To use this, add the line in bold to your custom_updater configuration.

custom_updater:
  track:
    - components
  component_urls:
    - https://raw.githubusercontent.com/bertbert72/HomeAssistant_VirginTivo/master/custom_updater.json

For more information on custom_updater, refer to the documentation at https://custom-components.github.io/custom_updater/

Example

This is a minimal example only and uses the online channel list. Use example1.yaml in the repository for a fuller example of setting up the online channel list and example2.yaml for a full set of manual channels. In /resources there is a tool to create the full channel list from the online source if desired.

  - platform: virgintivo
    tivos:
      1:
        name: Virgin V6
        host: TIVO-C68000020000000
    tvchannellists:
      enable: True