Control TiVo box over telnet


#81

@Wishywash

It wont let me upload the config file so see below

homeassistant:

Name of the location where Home Assistant is running

name: Home

Location required to calculate the time the sun rises and sets

latitude: 52.3942
longitude: -1.4808

Impacts weather/sunrise data (altitude above sea level in meters)

elevation: 0

metric for Metric, imperial for Imperial

unit_system: metric

Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

time_zone: Europe/London

Show links to resources in log and frontend

introduction:

Enables the frontend

frontend:

Enables configuration UI

config:

http:

Uncomment this to add a password (recommended!)

api_password: PASSWORD

Uncomment this if you are using SSL or running in Docker etc

base_url: example.duckdns.org:8123

Checks for available updates

updater:

Discover some devices automatically

discovery:

sensor:

  • platform: wunderground
    api_key: xxxxxxxxx
    monitored_conditions:
    • alerts
    • dewpoint_f
    • dewpoint_string
    • feelslike_f
    • feelslike_string
    • heat_index_f
    • heat_index_string
    • precip_1hr_in
    • precip_today_in
    • precip_today_metric
    • relative_humidity
    • temp_f
    • visibility_mi
    • weather
    • wind_gust_mph
    • wind_mph

Allows you to issue voice commands from the frontend in enabled browsers

conversation:

Enables support for tracking state changes over time.

history:

View all events in a logbook

logbook:

Track the sun

sun:

switch channel_502:
platform: command_line
switches:
502_youview:
command_on: 'echo SETCH 502 | telnet 192.168.0.18 31339’
command_off: 'echo SETCH 502 | telnet 192.168.0.18 31339’
friendly_name: Sky Sports Two

switch channel_501:
platform: command_line
switches:
501_youview:
command_on: 'echo SETCH 501 | telnet 192.168.0.18 31339’
command_off: 'echo SETCH 501 | telnet 192.168.0.18 31339’
friendly_name: Sky Sports One

switch channel_101:
platform: command_line
switches:
101_youview:
command_on: 'echo SETCH 108 | telnet 192.168.0.18 31339’
command_off: 'echo SETCH 108 | telnet 192.168.0.18 31339’
friendly_name: BBC One HD

Text to speech

tts:
platform: google

switch virgin_off:
platform: command_line
switches:
virgin_off:
command_on: 'echo IRCODE STANDBY | telnet 192.168.0.18 31339’
command_off: 'echo IRCODE STANDBY | telnet 192.168.0.18 31339’
friendly_name: Virgin off

group: !include groups.yaml

it has taken all of my identetation out but I know it is all good as have used the HAAS script config checker


#82

@Paul_Duggins - I think we are getting somewhere here - looking at your log file does tell us something - it tells us that it’s probably not HA that’s the problem.

If it was, you’ll be see errors like I just got when I turned my telnet service off:

17-04-26 22:08:57 ERROR (Thread-11) [homeassistant.components.switch.command_line] Command failed: echo SETCH 113 | telnet 192.168.0.38 31339

All of your errors look to relate to a Plex media player it’s previously seen, but can’t see any longer.

As @Rich_Paul suggested eariler, you need to be looking at the settings on the Tivo box for remote access and/or swapping out the network cable you are using to connect the Tivo box to your router.


#83

@Wishywash

thanks for looking the plex server is something I’m also having issues with but that is to do with the x token key

I’m not sure the problem is with the TiVo box either

if I use telnet I can connect to the box fine . Also while in telnet I can put in the commands that are in the config file (copy and paste the good bits) and they all work

What is interesting is if I just open a cmd prompt and do the line @Rich_Paul suggested before echo IRCODE STANDBY | telnet 192.168.0.10 31339 this also doesn’t work

I think the introduction of the command line is what is causing the issue


#84

One last thing to try then - Telnet is not enabled in Windows 10 - I’m not sure if this will help in anyway (my build is all on a Pi in Python, but anything seems worth a try) - Here is a guide for enabling Telnet on Windows 10 - give a go and see if it changes anything - http://windowsreport.com/telnet-windows-10/


#85

Thanks @Wishywash

can confirm that Telnet was already enabled.

Off to bed now but hope you and @Rich_Paul might be around tomorrow to continue my learning


#86

ok @Wishywash and @Rich_Paul

I have checked all my config through and all seems ok, all the other apps are responding ok in HA. Now have the TV and Hue Lights working

However no joy with the TIVO.

Im just guessing but as the tenet works ok im going to say it isn’t the TiVo itself .

If I try to use the cmd commands directly in a cmd prompt they don’t work either im guessing it might be that so wonder if there is another way to do it

I think if we manage to get it working straight from cmd and then play that command line in the yaml in might fix it

But would appreciate any more ideas


#87

My log returns these errors too, but it changes the channel for me…


#88
sensor 22: - platform: tcp host: 192.168.0.10 port: 31339

The above creates a sensor which will return what your box is doing… What channel it’s on, if it’s recording, if it’s on etc…


#89

Sorry for duplicate posting, they have just removed my new user restrictions so

Sorry guys had to create a new thread

So i coped the things from the last thread

Line 1 no space
Line 2 2 Spaces
Line 3,4 4spaces

sensor 22 :

  • platform: tcp
    host: 192.168.0.18
    port: 31339

But am getting the errors below, i have tried changing the spaces in like with the other sensor i have set up but still no joy

[31m17-04-27 10:31:03 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.tcp]: required key not provided @ data[‘host’]. Got None
required key not provided @ data[‘payload’]. Got None
required key not provided @ data[‘port’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.tcp/

Failed config
sensor.tcp:
platform: tcp
host: 192.168.0.18
port: 31339

Successful config (partial)
sensor.tcp:

On the url provided says im missing the payload maybe ??

I did do some digging and have added

payload: “r State\n”

the script checker now reports no errors , however i am getting nothing represented on the HA Home page


#90

I’m out of ideas mate… Probably a Microsoft issue you might need different on/off cmds.

Google is your best bet now…


#91

thanks for the help @Rich_Paul it is very much appreciated

@Wishywash - You got any more ideas, the whole idea of getting HA up and running was to get this functionality running so i can eventually put it all into Alex

So while i can control a lot of other things in here this is my primary goal


#92

Just set this up. It really is genius. Thanks for sharing!


#93

I ‘think’ I may have found the issue - and I don’t think it’s good news.

I did a bit of googling around the telnet client and found some test code here

But then I noticed it said the following at the bottom -

Note

The above shown program will work only on linux and not on windows. The program uses the select function read the command line input (stdin). On windows the select function cannot read file descriptors. It can only read sockets created inside winsock. The python documentation on select function mentions this

Going to the Python source library and it appears that windows has limitations on the select functions which would be affecting the telnet client - That’s how I’ve read it, but I am very new to this - @Rich_Paul care to cast an eye over my findings?


#94

@Wishywash and @Rich_Paul

I was beginning to think this might be the case so have just laid my hands on a raspberry pi 3

When I get 10 mins will install Hassbian and start the process from the beginning

The good news I guess is that I can continue to develop the config.ymal file on my windows box and then just copy that to my raspberry once it is all set up and running

Many thanks for all of your time and effort on this guys. Im sure it wont be the last time I come to you as once I get this part working intend to get in working with the amazon echo where I think @Wishywash you have just completed


#95

Indeed and it is totally worth the effort @Paul_Duggins. Let me know if I can help further down the process - hopefully you’ll get the emulated hue to work (because it is the easier option) but if you end up going down the Haaska route like me and get stuck (it took me 5 hours to work out those instructions) - let me know and I’ll help out if I can.


#96

@Wishywash - Many thanks for the offer, I might come to you later down the line for more coding. If you have an email address your happy to share then can also converse via there if that suits you. Once again thanks for all your efforts


#97

Ok @Wishywash @Rich_Paul

So last night I managed to install Hasspian 1.1 on the Raspberry Pi3 I have acquired
I have started to put some of the code into the yaml file but am testing this one bit at a time
I have also installed samba for the file sharing and telnet but im sure there is a lot more configuration needed to get the TiVo to now do what I need it to

As a first time user of a raspberry and no experience of the system at all is there a list of next steps I need to follow now in order for this to work. For example

  1. configure this
    2 install that

As you can see I am clearly a very novice user so please make it as idiot proof as possible


#98

To be honest there are a few steps I’d advise with a Pi - like adding SSL and setting up your ports - to make sure any connections you setup are secure.

I followed this video https://youtu.be/G8XWsXlfGFQ and it took me through everything first time.

From there I was able to learn enough to make any changes I needed too.

Once your Pi is fully setup as in the video, you’re ready to follow @Rich_Paul’s guides above and you should be set.


#99

Many thanks @Wishywash


#100

I followed this guide when I installed ha aswell… Its good and detailed