Control TiVo box over telnet

Hi All,
I’m a new Home Assistant user so be gentle with me! I do have some experience of programming and Home Automation in general (having a Vera Edge and Amazon Echo & Dot).
I tried:
echo SETCH 144 | telnet 192.168.0.XXX 31339
from a command prompt on Windows 10 and couldn’t get it to work so I looked for alternatives.

I downloaded ncat (the portable version, a single executable file) from here:
http://nmap.org/dist/ncat-portable-5.59BETA1.zip

and used it like this:
echo SETCH 114 | \path\to\ncat\ncat --send-only -t -n 192.168.0.XXX 31339

It only works with the “–send-only”, the command hangs otherwise

I also found this about the protocols
https://www.tivo.com/assets/images/abouttivo/resources/downloads/brochures/TiVo_TCP_Network_Remote_Control_Protocol.pdf

Hope this helps someone
Dave

Has anyone figured out how to use this on a mac yet? I’m tearing my hair our just trying to change channels with 'echo SETCH 163 | telnet 192.168.0.6 31339. It’s something to do with the I think but I cannot find a way of making it work.

Gave you enabled network access on your tivo?

Yes thanks. I can easily change channels by Telnet 192.168.0.6 31339 the SETCH 163 but not in the above syntax.

guys, if its of interest, there is a Alexa skill for controlling the tivo here https://github.com/jradwan/alexa_tivo_control

Just curious is someone making this into a HA “component” or is the best approach still to do it by scripts?

Since 0.54 (September 17), you can use the telnet switch natively without having to resort to calling the command line echo. Here’s an example from my configuration.yaml, where TIVO-CF0010123456789 is the DNS name of the Tivo box.

switch:
  platform: telnet
  switches:
    tivo_guide:
      resource: "TIVO-CF0010123456789"
      port: 31339
      command_on: "IRCODE GUIDE"
      command_off: "IRCODE GUIDE"
      command_state: ""
      value_template: ""
      name: Guide
    tivo_info:
      resource: "TIVO-CF0010123456789"
      port: 31339
      command_on: "IRCODE INFO"
      command_off: "IRCODE INFO"
      command_state: ""
      value_template: ""
      name: Info
2 Likes

Just trying this now…

have you managed to report state at all? I’d really like to know if it the box is on off not to make my automations a little better. I have a TCP sensor which tells me what channel its on, but takes a while to update and i cant seem to automate using the state.

e.g
sensor.tcp_sensor = CH_STATUS 0105 RECORDING

Afraid not. I’ve only got what you have, i.e. an up to 30 second delay to report the channel.

I started working on the following a few days ago. Channel up/down should work with the default html, etc.:

1 Like

Hi! Thats great news.
How would one go about installing this component in hass.io because I dont see that file structure exposed in samba. I guess right now its only possible in hassbian?
I’m happy to help where i can as long as i can figure out how to get this installed

@milosch01 never mind the last message… I’ve installed this and running into issues. I’ve opened an issue at github. I’m happy to help on this once I can get it going and have a basic understanding. I’m a coder, but not python but im sure once i get it going I can dive in :slight_smile:

I have responded to your issue. I wonder if there is more to the error than what you included.

No more “Alexa, turn the volume up on” using routines in the alexa app!

List item

Hello mate,

Iv managed to report the state in an automation (the trick was to create another sensor which reported the state of the initial one) so thought i’d let you know

Take a look here:

sensor:
  - platform: tcp
    host: 192.168.0.10
    port: 31339
    payload: "IRCODE PAUSE\n"
  - platform: template
    sensors:
      virgin_status:
        friendly_name: 'Virgin status'
        value_template: '{{ states("sensor.tcp_sensor") }}'

automation tv lights on:
  alias: TV on - TV lights /Virgin on
  trigger:
    platform: state
    entity_id: media_player.sony_tv
    from: 'off'
    to: 'on'
  action:
    - service: homeassistant.turn_on
      entity_id: light.tv_lights
    - service: homeassistant.turn_on
      data_template:
       entity_id: >-
         {% if is_state('sensor.virgin_status', 'COMMAND_TIMEOUT') %} 
           switch.virgin_power
         {% else %}
         # do nothing
         {% endif %}

So now my box wont turn on when i try to turn a group off, and vice verca.

Would have been far easier if the there was a separate button/call to turn the box on and off, rather than a single one which toggles.

Hope this helps

Did you get it to work?

I moved close to this and didn’t have tivo in our new place so I didn’t really put in any effort.

I’ve pulled together a Tivo custom component specifically for Virgin Media boxes in the UK. I doubt if it’ll be much use to any non VM Tivo users unfortunately since it is very tied to the VM functionality.

Full details are on the GitHub repository, but in addition to the usual change channel, pause/play, turn off/on, it hooks into the VM What’s On guide in order to provide programme info. It has all the benefits and limitations of that guide, e.g. limited number of channels, but good info and the ability to show a screen grab of the currently playing programme. In addition it can automatically switch to the HD version of a channel and flick to the +1 version if available.

3 Likes

That’s tomorrow sorted! I’ll let you know how I get on :+1:

I don’t use many channels but detecting state will be useful for my automations. I have a tcp sensor atm but it sometimes takes a while to update

Let me know how you get on. On mine I’ve set scan_interval to 1. Means everything is pretty quick. Probably some better way to do that but works for me :slight_smile: