Myq componenet issues

Sure!

Here you go:

I have absolutely no idea what the problem is. @mplawner, I’m now using an exact copy of your myq.py.

my configuration.yaml is just:

garage_door:
platform: myq
name: Garage Door Opener
username: “[email protected]
password: “password”

and I’m still getting the same error. On the off change this was a cert problem (pi trusting myq’s api cert) I stood up a Windows VM, did a barebones install of HA, stuck the bit above in the configuration.yaml, and copied in the myq.py. Same error. I just deleted and recreated my liftmaster myq account and repaired the door to my account. Same error.

Since I’m using the same myq.py, and it seems like there’s nothing I could be screwing up in the configuration.yaml, I’m stumped. Any other thoughts? Please tell me I’m missing something stupid…

@mplawner if you run the below, after updating user/pass:
https://myqexternal.myqdevice.com/Membership/ValidateUserWithCulture?appId=Vj8pQggXLhLy0WHahglCD4N1nAkkXQtGYpq2HrHD7H1nvmbT55KqtN6RSF4ILB%2Fi&securityToken=null&username=**account_username**&password=**account_password**&culture=en

What is your return value? I’m getting:

{“UserId”:0,“SecurityToken”:“alphnumeric string”,“ReturnCode”:“0”,“ErrorMessage”:“”,“BrandId”:1,“BrandName”:“Liftmaster”,“RegionId”:1}

And I guess I’ve just been assuming that’s the appropriate response

Yup. Same:

{"UserId":0,"SecurityToken":"alphanumericstring","ReturnCode":"0","ErrorMessage":"","BrandId":1,"BrandName":"Liftmaster","RegionId":1}

@mplawner, I really appreciate the assistance and the patience.
@goyney any ideas?

I don’t know what the next step would be here. I’ve posted on the subreddit, I’ve tried reaching out to folks on glitter. I’d really prefer not to return the Myq. Any other ideas?

I don’t know. Grabbing at straws here but…

  • Is myq.py in your ~/.homeassistant/custom_components/garage_door/ directory?

  • Since you changed the myq.py file, did you blow away the __pycache__ directory in that folder (I honestly don’t know if that does anything… but I remove it)?

  • Do you have the proper spacing and -'ing in the configuration.yaml? Perhaps it isn’t picking up your username? Note I’m using an include in configuration.yaml and a separate garage_door.yaml file with the contents as I described above:

### Garage ### garage_door: !include garage_door.yaml

  • Have you started from the command line? When started up at the prompt from hass, typically more info scrolls past on the screen than gets logged to the home-assistant.log file.

Sorry, that’s all I’ve got

The other thing you may want to do…
You are failing on (now) line 82:

    self.security_token = auth['SecurityToken']

Perhaps you want to try writing the URL of the login to the log file to ensure the right call is being made? I’m not a python programmer by any means, but I guess it would be something like (between auth = login.json() and self.security_token = auth['SecurityToken']):

logging.getLogger(__name__).info('https://{host_uri}/{login_endpoint}'.format(host_uri=self.HOST_URI,login_endpoint=self.LOGIN_ENDPOINT),params=params)

I have no idea why that worked. With the garage_door component in configuration,yaml, I had tried blanking username and password, and got the expected “missing username or password” in log.

However, once I moved to the !include for the garage_door component, I’m a step further. I’m now seeing a group.all_garage_doors in the entities list!

Unfortunately, the state is “unknown” and I don’t see an entity for the actual door. From looking earlier in this thread, it appears that has to do with the naming of the device in the myq app. I have the door named “GarageDoorOpener” and in the Myq app, in the garage_door.yaml. I’m using a copy of your (@mplawner) myq.py.

It feels like I’m just one step away from having this working…

In the myq.py that I provided it doesn’t matter what you name the garage door, nor how many you have. That shouldn’t be the issue.

@mplawner, thank you so much for all your help! For some reason, I had to flip my device type name in the myq back to VGDO and then I get the garage door in my dashboard and can control it through HA:

    for device in devices:
        if device['MyQDeviceTypeName'] == 'VGDO':
            for attribute in device['Attributes']:
                if attribute['AttributeDisplayName'] == 'desc' and \
                        attribute['Value'] == 'GarageDoorOpener':
                    garage_doors.append(device['DeviceId'])
    return garage_doors

Interesting! If this ever becomes a real component, this difference should be identified. Meanwhile, glad you’re up and running!

This is no longer working in .27 because garage_door component has been deprecated in favor of cover component

Any idea if we need to replace instances of garage_door in the myq.py file as well as the configuration.yaml?

Now that we’ve been able to get myq working under garage door, what do we need to do to convert it to the cover component?

Here’s my current updated script to work with the new Cover component: http://pastebin.com/02u8jR2U

I went ahead and refactored it a bit to be a little friendlier to use overall. This means that you need to modify your yaml as well to include a new “brand” configuration option, which can accept ‘chamberlain’, ‘liftmaster’, or ‘craftmaster’.

The only thing I haven’t figured out yet is if I like the new UP, STOP, DOWN buttons and how to show the current state. It updates the state, it just appears that there isn’t actually a place this is shown on the UI.

2 Likes

Thank you very much for the updated script. Nice work!
But… I seem to be a little lost on the configuration for cover. Can you show me what you have set up for cover, please?

I placed the above py file in: /home/hass/.homeassistant/custom_components/cover/myq.py

My configuration.yaml:

cover:
  - platform: myq
    name: Garage Door
    username: !env_var MYQ_USERNAME
    password: !env_var MYQ_PASSWORD
    brand: chamberlain
1 Like

Playing around with it a bit more, I implemented the current_cover_position property which allows the OPEN and CLOSE buttons to enable and disable based upon it being closed (0) and open (100). This at least shows the current state of the garage door in some way, but it has the side effect of enabling the position slider in the popup status dialog.

This entire cover refactoring feels like it needs a lot more work to be fully realized. Even just allowing some configuration properties like can_stop, can_tilt, can_position, and then allowing for statuses like STATE_OPENING, STATE_CLOSING, or STATE_TRANSITIONING would be a massive improvement.

Anyways, this is the latest myq.py file: http://pastebin.com/qVszax1t

1 Like

I have a question, does anyone know if there’s a way we can use the MyQ names for these nodes? I have two garage door openers and it just names them for me and I’d prefer to at least assign the friendly name from MyQ instead of them both being the same.

Thank you, the problem turned out to be that I had forgotten to rename the directory from garage_door to cover.
Thank you again.