Control TiVo box over telnet

@Rich_Paul
I have the component installed but not sure how to control via Alexa do i have to install something else to get it to work? if not what are the commands to change channel etc? Thanks in advance for any help given

@garywilson4 try this

Everything you need is on th a thread

could you elaborate a bit please ;p lol

switch channel_28:
  platform: telnet
  assumed_state: True
  switches:
    e4_virgin:
     resource: '192.168.0.10'
     port: 31339
     command_on: 'SETCH 106'
     command_off: 'SETCH 106'
     name: Channel one

The above is using a cmd line switch.

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

The above uses the component. Both found in this thread.

Moreā€¦ 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

ok before i try to go further iā€™m getting some errors in the log

Empty response for command:

12:13 AM components/switch/telnet.py (WARNING)

Command ā€œā€ failed with exception: ConnectionResetError(104, ā€˜Connection reset by peerā€™)

12:13 AM components/switch/telnet.py (ERROR)

Update for switch.tivo_info fails

12:13 AM components/switch/telnet.py (ERROR)

Virgin: timeout on connection, will retry

12:13 AM custom_components/media_player/virgintivo.py (WARNING)

Empty response for command:

12:13 AM components/switch/telnet.py (WARNING)

Empty response for command:

12:13 AM components/switch/telnet.py (WARNING)

Updating virgintivo media_player took longer than the scheduled update interval 0:00:01

12:12 AM helpers/entity_platform.py (WARNING)

Updating virgintivo media_player took longer than the scheduled update interval 0:00:01

12:12 AM helpers/entity_platform.py (WARNING)

Update for switch.tivo_guide fails

12:12 AM components/switch/telnet.py (ERROR)

Update for switch.tivo_info fails

12:12 AM components/switch/telnet.py (ERROR)

Updating virgintivo media_player took longer than the scheduled update interval 0:00:01

12:12 AM helpers/entity_platform.py (WARNING)

Virgin: timeout on connection, will retry

12:12 AM custom_components/media_player/virgintivo.py (WARNING)

Empty response for command:

12:12 AM components/switch/telnet.py (WARNING)

Empty response for command:

12:12 AM components/switch/telnet.py (WARNING)

Virgin: timeout on connection, will retry

12:12 AM custom_components/media_player/virgintivo.py (WARNING)

any ideas what iā€™ve done wrong before i move on to the switches? this repeats over and over

What approach are you using?

Try the example I gave

iā€™m brand new to hass.io and iā€™m not entirely sure of what iā€™m doing, for the moment iā€™ve removed it all from my configuration.yaml file. as for your example i just donā€™t understand it and therefore how to implement it is beyond my scope for now. Iā€™ll mess with it again later today

ok iā€™m ready to mess with this again today :grinning:
as for approach i was hoping for a plug and play option with maybe a little bit of yaml coding but it seems that option isnā€™t available yet so I really need walking through things a little which approach would you recommend ?
using the component in your example looks complicated and iā€™m not sure where it all goes (and how it works) i.e do i have to set up the empty switch for each channel? maybe you could share the tivo sections of your yaml files to give me a base as to where to start? it would be very helpful rather than taking up a lot of your time trying to help in here

@Bertbert seems your channel list is outdated again

1 Like

@Rich_Paul I donā€™t know where iā€™m going wrong I canā€™t get alexa to find the new switches in HA using the component version you posted and itā€™s took me all day to figure out that name should be friendly_name in that example too if i had much hair iā€™d be pulling it out now lol

Thanks for the heads-up. Iā€™ve updated example.yaml accordingly.

ok got alexa finding them now i had put the automation in automation.yaml and it didnt like that

@Bertbert donā€™t know if its possible but is there a way to have the channel list show depending on the package you have i.e mix or player or full house etc the way i envision it would be an input option for the packages and then it sets the show to true for the channels in that package (you could also include HD and +1 in that selection too)
also donā€™t know if you know of this site it may be of help to you

Oh yea I have everything in one file. Youā€™ll have to drop the automation xxx: and add an id as far as I know. Iā€™m also on hassbian, not hassio.

Have you got it working now? Iā€™d recommend using @Bertbert component over my switch. If you have both it can cause issues as telnet only really works with one connection at a time

Yeah I think I got it now Iā€™m mainly using the component but have guide and info set up using yours as I havenā€™t figured out how to do it the component way yet. Iā€™m going to try splitting them out again tomorrow as I think it was the formatting I got wrong before. I can but try and if it doesnā€™t work I can put them back

Btw is it normal to get 2 devices per switch in Alexa I think one is the automation and one is the switch?

It would be possible to have something defined in the yaml, e.g.

  - platform: virgintivo
    default_is_hd: true
	show_packages: Free-to-air,Player,Mix,Fun,Full House
...
    channels:
      100:
        name: Virgin Media Previews
        package: Mix
...
      122:
        name: Sky Arts
        hd_channel: 206
		package: Mix
		show: false
...
      204:
        name: Netflix
		package: Premium
		show: true

Is that what youā€™re thinking? In the example above, itā€™d show everything bar the Premium and Pay-per-view packages and Sky Arts, but would include Netflix.

yes that way you could just add the package you have and only those would show in the list. Is this something you need to implement in the python script or is it purely done in the yaml file?

Iā€™ve now implemented it in the component and updated the channel list with the package name. Usage is pretty much what I put above, e.g.

show_packages: Free-to-air,Player,Mix,Fun,Full House,Premium,Pay-per-view

This takes priority over the default_is_show setting if both are set. Itā€™s optional, so if ommitted itā€™ll work as before.