Control TiVo box over telnet

Hi BertBert, did you have any luck fixing this? Thanks!
Mat.

Afraid not. I’ve had a few goes but no success. If I get it so that it accurately reflects the state, I find that the on/off no longer works and vice-versa. Coupled with the fact that the family tend to be unhappy with me turning off the box constantly, it’s slow going. The complication is that there isn’t actually an off state, just a state where the box doesn’t respond with anything when checked. But I keep thinking it is bound to be possible to reliably infer the status. I keep thinking I have it and then I find that it doesn’t work in one situation or another. Very annoying :smile:

1 Like

Try this one if you are feeling brave. I’ll have to tidy it up if it works, but I think it should.

https://raw.githubusercontent.com/bertbert72/HomeAssistant_VirginTivo/fix-off-on/custom_components/virgintivo/media_player.py

Edit:

New version up that seems to work properly in all scenarios. Fingers crossed anyway!

1 Like

Looks straightforward enough. I’ll have a go once I get on/off finally sorted or I give up on it…

Edit:

I’ve added support for the custom_updater stuff

thankyou i think its working correctly again! great work!

any chance of integrating this into the new home assistant community store? HACS

I’ve sent a pull request to get it integrated into the next version of HACS. In the meantime you can add it yourself using bertbert72/HomeAssistant_VirginTivo

1 Like

Bertbert, you mention that it’s possible to use the Tivo remote to control other devices. I would like to change the input source of my TV to the Tivo input anytime the Tivo remote buttons are pressed. Any pointers on how to achieve this greatly appreciated.

Not sure this is going to be exactly what you want. The component has no way of knowing if you’ve pressed a button on the remote. The only thing it can really tell is if the channel has been changed because that’s all the telnet interface on the Tivo tells it.

The way I’ve set it up is that if I use one of the channels I don’t care about (in my case 901, 902, 903) I can press 901 to get it to switch to the Virgin Box, 902 to go to the Tivo and 903 to show the CCTV.

In the example below, the switcher box is set up as “family_room_receiver”. You’d put in say something like ‘media_player.my_tv’ and for sources something like ‘901: HDMI1’.

      targets:
        901: media_player.family_room_receiver
        902: media_player.family_room_receiver
        903: media_player.family_room_receiver
      sources:
        901: Virgin V6
        902: Virgin Tivo
        903: CCTV

Let me know if that helps or doesn’t help.

Ah, very clever. Do you think there is a way of using a trigger of a channel change to switch inputs, just using the channel up/down on the remote rather than a specific channel?

Has anyone has any issues after upgarding to hassio v0.97?
I get this error in the log now and can’t find the tivo any more:

2019-08-08 20:23:27 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for virgintivo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-08-08 20:23:27 ERROR (MainThread) [homeassistant.config] Failed to get platform media_player.virgintivo
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config.py”, line 795, in async_process_component_config
platform = p_integration.get_platform(domain)
File “/usr/src/homeassistant/homeassistant/loader.py”, line 235, in get_platform
“{}.{}”.format(self.pkg_path, platform_name)
File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/config/custom_components/virgintivo/media_player.py”, line 23, in
from homeassistant.components.media_player import (
ImportError: cannot import name ‘MEDIA_PLAYER_SCHEMA’ from ‘homeassistant.components.media_player’ (/usr/src/homeassistant/homeassistant/components/media_player/init.py)

At the moment, no. But I can have a look at the weekend. Might be able to get something to fire any time the channel number changes.

I’ve just put a fix up for this. Should be available via HACs etc too.

1 Like

You’re a good man @Bertbert

Your very kind to help me out, it’s beyond my abilities TBH. I just bought a new TV and now have an extra remote just to change sources. Anyway to remove it would be great, thanks!

Quick question before I start on this. Does your TV currently have the capability of being changed to the correct source via Home Assistant? If so, what do you use e.g.

service: media_player.select_source
entity: media_player.my_main_tv
service_data: {"entity_id": "media_player.my_main_tv","source": "HDMI1"}

If you can’t currently get Home Assistant to control the TV, that’s the first step. The component will rely on calling an existing service to change the source. I need to know the above in order to decide how much will need changed. Currently it only calls the media_player services (just a bit of lazy hard-coding on my part) so if it needs to be able to call other services, I’ll need to change that.

Hi Bert, sorry for not getting back to you sooner. I was trying to find the most efficient way of switching channels on my Philips TV. I’ve been trying to use some of the components available on HACS but with no success yet. It’s probably best if I can work out how to change the sources first before you spend your valuable time trying to help me. I’ll get back to you once I have the source switching figured out but can I thank you just now for your time and replies.

No problem. I spent a very small amount of time on it and got it half working. Half working means half not working too, but it is feasible.

One thing just in case you aren’t aware, the V6 remote (if that’s what you’ve got) can be set up to change sources by holding down the TV button. You’ll have to have set up the universal remote bit and as there are several codes for each make of TV, the first one you find that controls volume may not be able to control the HDMI sources.

1 Like

Great, that’s maybe all I need!

I’ve just added the component via HACS and added the following code to my configuration:

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

I can see it appear as “media_player.virgin_v6” but it says the box is off, which it isn’t and the state attributes come back as:

{
  "prog_title": null,
  "prog_description": null,
  "prog_start_time": null,
  "prog_end_time": null,
  "prog_type": null,
  "prog_episode_title": null,
  "prog_episode_number": null,
  "prog_series_number": null,
  "base_channel_name": "Live Events Channel",
  "friendly_name": "Virgin V6",
  "supported_features": 22961
}

What am I doing wrong?

Edit: fixed my own problem by changing the host to the IP of the box rather than the name. I’ll admit I don’t understand why the name of the box wasn’t working.