Controlling Ryobi GDO Garage Door via HA

No problem. Stroke of luck figuring it out. Thanks for letting me know as I was beginning to wonder if it worked for anyone else.

Sorry I haven’t chimed in. Busy week. But all is well here as well.

Thanks!

Trying to get my door ID, The script is working, as I can use it to browse all of the metadata about my door. The initial code pulls the “deviceTypeIds” value out of the array. I have tried that as well as the “_id” value. In both cases I get a message stating the value is “not in your device list”.

Anyone else have a similar issue?

EDIT: Posted too soon. I figured it out. The integration wants the “varName” variable. For anyone else that has the issue, you should be able to change

print(doorval[1])
to
print(doorval[5])

in the doorid.py script. If it comes back with a value labeled “varName” you should have the right ID.

1 Like

Glad you got it working and posted the fix too. Thanks!

Any chance someone has looked into making this work with websockets so we can get instant status from the door or light or other accessories?

I wrote a plugin in C# for homeseer that did this, and it worked quite well. I’m pretty inexperienced in python otherwise I’d give it a whirl. It’ll be on my list if no one else steps up for this.

The commands are pretty simple, and you just subscribe to a topic. I’ve thought about building a ryobi to mqtt bridge, but I’d sort of like this to live on my HA box, and not rely on C# just because that’s what I know.

All in all the API isn’t too hard to figure out

wss://tti.tiwiconnect.com/api/wsrpc

you subscribe to the topics for each GDO device id, then you get notifications for door or module updates.

edit: looking at the code, it’s looking like you already connect to the websocket when sending a message, but then close it. You can subscribe to messages and leave the socket open and then you don’t need to do polling update commands.

I made a little bit of progress last night learning some python as I go. I was able to connect to my GDO using username and password, get the api_key and retrieve a list of the devices (GDO’s, I only have one, so eventually I’ll need someone to test multiple openers)

I was then able to connect to the websocket service and subscribe to changes. I successfully watched the changes come in when I was remote controlling the GDO using the Ryobi app…

This is pretty much what I did when I was writing the homeseer plug-in. From there I’m going to have to figure out how interact with HA devices. I think controlling all of the ryobi accessories will be possible, I can turn on and off my parking laser, and the fan I have attached, this can’t be any different that what I wrote before (just a different language) However I won’t be able to test any device I don’t have.

Next up is parsing the json that is received when a message comes in, and updating HA devices…
Then I’ll want to figure out how to push the messages back to the service, but it looks like there is already an example of that and I know what the JSON should look like already.

If I remember right, I should be able to get info for most of the accessories.

ENVIRONMENTAL_SENSOR = 0 (don’t think this was ever released)
PARK_ASSIST = 1
BLUETOOTH_SPEAKER_MODULE = 2
FAN_MODULE = 3
INFLATOR = 4
BACKUP_CHARGER_MODULE = 6
CAMERA_MODULE = 10

The missing numbers here make me wonder if there was more planned?

Yeah, my python knowledge is pretty limited as well. I took what was given to me from the old maintainer and ran with it modifying it here and there. In theory you should be able to take the code we already have in github and get some of the home assistant integration methods. My dilemma though is that I have very limited time due to two toddlers and work. This leaves me little time to do more with this. Happy to help though if there is something that I can help with. I’m on discord so if you wanted to setup something there, we could. The new zwave-js integration is also using websockets so that might give some ideas too.

[quote=“Madj42, post:41, topic:211635”]
My dilemma though is that I have very limited time due to two toddlers and work. This leaves me little time to do more with this.[/quote]

No toddlers here, but I don’t have a ton of time to dedicate just yet. I think at some point I’ll give it a more serious look, but I do want to get my python skills up a bit more before I’m ready to suggest other people run code I’d written on their home automation systems.

1 Like

I am having a small problem I am getting the following error when I start Home assistant:
021-06-11 22:49:40 ERROR (SyncWorker_1) [custom_components.ryobi_gdo3.cover] XXXX not in your device list

Is this an easy fix maybe I am missing somthing?

The deviceid you are specifying in the configuration is not correct. Does the device entity show in HA?

No, it does not. I am using the _id value is that correct here is what my configuration looks like:

image

config:

cover:
  - platform: ryobi_gdo3
    username: !secret ryobi_username
    password: !secret ryobi_password
    device_id:
      - !secret ryobi_device_id
      - !secret ryobi_device_id2

light:
  - platform: ryobi_gdo3
    username: !secret ryobi_username
    password: !secret ryobi_password
    device_id:
      - !secret ryobi_device_id
      - !secret ryobi_device_id2

Secrets:

# Use this file to store secrets like usernames and passwords.
# Learn more at https://www.home-assistant.io/docs/configuration/secrets/
some_password: welcome
ryobi_username: "[email protected]"
ryobi_password: "XXXXXXX"
ryobi_device_id: "607f50536f65be592589c133"
ryobi_device_id2: "607f50cfbcbfc2abb091bd13"

I got it! it was varName, not _id. Leaving this here for anyone else who may run into some issues.

HA newbie here.

I don’t understand this instruction.
“Put this in your custom_components folder under ryobi_gdo3 and restart Home Assistant.”

I edited the secret yaml and config yaml. i also created a folder called “custom_components” what am i missing?

You need to out the ryobi_gdo3 folder in the custom_components folder. Make sure the files on GitHub that are under that folder are in it as well.
.

ok, done. now I can see a card in HA; however, the status is wrong and I can’t control it.

import requests

username = ‘username’ ← changed to my email with quotation

password = ‘password’ ← changed to my password with quotation

uandp = {'username:username,‘password’:password}

r = requests.post(‘https://tti.tiwiconnect.com/api/login’,data=uandp)

s = requests.get(‘https://tti.tiwiconnect.com/api/devices’,params=uandp)

s_dict= s.json()

s_dict= (s_dict[‘result’])

doorval= str(s_dict)

doorval= doorval.split(’,’)

print(doorval[1])

You need to run the above with python to get the door id. Once you have that, you need to follow the instructions on GitHub. Essentially you need to make sure the Ryobi_gdo3 folder is under the custom components directory and you need to make sure the files on GitHub under the ryobi_gdo3 folder are in that ryobi_gdo3 folder.

i got the door id from “varName” and i put them in the secret yaml along with my login info.

i got the card but the status is not correct

ok, i found the problem. apparenlty, there are 2 varname. I used the first one and didn’t know. second one did. but not sure why

@jefftse this happened to one other person. Did you have to reset the door previously? I think the app may recreate a new door id in some instances. It took the other person some trial and error to find this just like you. Thanks for reporting back what it was.

1 Like