Control TiVo box over telnet

@Rich_Paul, let me know what you’re currently doing and I’ll look at adding in something for it.

@xAPPO, I wouldn’t have thought any telnet stuff was required. The component should just install whatever dependencies it needs - it doesn’t use telnetlib. Unless you’re using one of the automations that use telnet which are separate. But if it works, all good.

@HassCasts :smiley:

I have a cmd line script - cmd_on fires IRSEND ADVANCE, and so does the cmd_off. I then use an automation to toggle between on and off for the length of the break. By switching it on, the automation rule will flick it on and off until it reaches 3.5 mins or 5 min.

The ADVANCE command fast forwards 30 seconds each tine it’s turned on and off, so i just turn it on and off 5 times each to achieve a 5 min break skip.

With me?

Ok, that’s added as an optional extension to the virgintivo_ircode service. You can now tell it to repeat the same command X times, e.g.

{"entity_id": "media_player.virgin_v6", "command": "advance", "repeats": 10}

That’ll issue 10 “advance” commands, which equates to a 5 minute skip.

How do i invoke it?

  • service: media_player.virgintivo_ircode
      data:
      repeat: 10

Was just typing a reply. More or less what you’ve got.

service: media_player.virgintivo_ircode
entity_id: media_player.virgin_v6
data:
  command: advance
  repeats: 10
service: media_player.virgintivo_ircode
data:
  command: advance
  repeats: 10
  entity_id: media_player.virgin_v6

Slight error in that mate, need to move the entity Id into data. Odd tho, all my other automations are how you’ve written it.

Top work mate, no more sketchy ad breaks = no more angry wife (ish)

Probably my dodgy code. Don’t see why it isn’t working like other components though since all the ones I’ve checked are doing it the same way. But if it’s working, I’ll probably just leave it alone unless it suddenly becomes obvious to me what’s going on.

@Bartbert This is great thanks for this, I was stringing together IR commands and found that sometimes it would miss out a number.

Edit. typo as I was missing a quote

Here is what it should be { “entity_id”: “media_player.virgin_v6”, “source”: “BBC One” }
I can now switch on BBC One before 9am and then switch to Channel 4 in the eve thank you!

_Is there a way to call the change source, I am using node red, and I have been trying with e.g. _

{ “entity_id”: "media_player.virgin_v6, “source”: “Channel 4” }

But I am guessing because there is no source service this will not work.

@Bertbert mate what service do i use to set a channel? I cant seem to find any, i was thinking something like this:

switch:
      virgin_e4:
        sequence:
          - service: media_player.virgintivo_setch
            data:
              entity_id: media_player.virgin_v6
              base_channel_name: E4

I am finally going to convert buttons for all the channels i use but cant seem to find a service that does it. I had a look through your code and can only see one reference to setch - how did you do it?

Yeah this is it. @bagg3rs give this a go mate. You will need an empty cmd line switch as the trigger:

switch channel_101:
  platform: command_line
  switches:
    101_virgin:
     command_on: ''
     command_off: ''
     value_template: ""
     name: Channel one

 
automation channel1:
  - alias: Channel 1
    trigger:
      - platform: state
        to: 'on'
        entity_id: switch.101_virgin
    action:
      - service: media_player.select_source
        data:
         entity_id: media_player.virgin_v6
         source: BBC One

im using an empty switch which does nothing ,as the trigger, that way i can use it through alexa

edit:

in the same automation i reset my switch to the off position each time it fires, so its ready for next time:

  - service: homeassistant.turn_off
    entity_id: switch.101_virgin

Its a bit of a mouthful, but no different from using an input_select i guess

1 Like

Thanks for the tip. Is that with the Alexa component? I have only been using Alexa “alexa-local” Node Red, which works well simple on off % but might have to setup that up fully if I can change the Channel.

I use emulated_hue to control my ha devices using alexa, I have over 80. I probably wouldn’t use ha too much without it, other than my automations

What version of Echo are you using to control HA? Just finished inputting all the channels to my configuration.yaml, all the way down to:

switch channel_832:
  platform: command_line
  switches:
    832_youview:
      command_on: 'echo SETCH 832 | telnet 192.168.0.12 31339'
      command_off: 'echo SETCH 832 | telnet 192.168.0.12 31339'
      friendly_name: France 24 Francais

switch channel_833:
  platform: command_line
  switches:
    833_youview:
      command_on: 'echo SETCH 833 | telnet 192.168.0.12 31339'
      command_off: 'echo SETCH 833 | telnet 192.168.0.12 31339'
      friendly_name: HUM Europe

I can change the channels via my phone or laptop, but getting Emulated Hue to work with my Echo Dot v2 just doesn’t want to happen. Thought it might be because of the number of devices but you say you have over 80 - so more than the 49 documentation says - so can’t be that.

Have you exposed switches in emulated hue?

  • switch

Iv stopped using cmd line telnet commands now and moved over to @Bertbert component. It consistently works

I tried getting @Bertbert component to work; it seemed to work after installing but I couldn’t change the channels, so I rebooted the Pi and now gives an error message: “Updating VirginTivo media_player took longer than the scheduled update interval 0:00:01”.

@Bertbert

hi mate, just noticed something

Your component only reads the state set by the component. If i use my remote and hit ‘play’ the state still shows paused in ha. It only updates if i use the component again.

This means if the remote is used i no longer know if its paused/playing. All the other information changes immediately

any thing you can do?

Hi Rich - afraid not using the telnet interface. It’s very limited in the information it gives. Basically just which channel is being viewed and what changed to that channel, or an error if one occurred. So beyond that I have to just rely on what the component itself has done.

Ah that’s a shame. I assume its the same for recordings?

Iv built an automation which will skip the correct advert length, based on whst channel is on. Ie, itv 3.5 min, ch 4 is 4minutes,e4 and 5 channels are 5 min. I also think the length is based on the time of the day… But…

Thing is, I can only skip the advert when watching recordings (as its not live TV) and as the component doesn’t report what channel it was recorded in (in fact the v6 goes to off state when you play a recording) my new automatons are useless.

Suggest any workaround? I just need the channel or the recording essentially, if that’s possible?

Again, sadly not. Whilst we can issue most commands through the telnet interface, the information that we get back is limited to that CH_STATUS 101 LOCAL stuff. And as you say, once you start playing a recording it stops even sending that. So no way of telling what channel a recording was from. The telnet interface is just too primitive.