Myq componenet issues

I think the only thing that is transmitted to the server is the door position state. We could directly poll the light status with a GPIO relay on a RPi.

I can’t seem to determine what would be easier and/or more integrated feeling, the addition off one z-wave motion sensor or the GPIO relay, opinion?

The motion sensor would be a more seamless integration. Walk into the garage, lights come one. Leave and lights turn off. The only benefit of the GPIO route would be (possibly) cost and keeping the garage lights in sync with the integrated opener light.

I don’t think light status is available via the api. See my API response below.

{
  "MyQDeviceId": 12888,
  "ParentMyQDeviceId": 1285,
  "MyQDeviceTypeId": 2,
  "MyQDeviceTypeName": "GarageDoorOpener",
  "DeviceId": "170074",
  "DeviceName": "CG0839C",
  "TypeId": 47,
  "TypeName": "Garage Door Opener",
  "RegistrationDateTime": "2016-08-18T02:33:15.777",
  "SerialNumber": "CG0839C",
  "UserName": "rbl.com",
  "UserConnectServerId": 1,
  "UserCountryId": 0,
  "Attributes": [
    {
      "AttributeId": 4614,
      "Name": "online",
      "Value": "True",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 135,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "online",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    },
    {
      "AttributeId": 571,
      "Name": "gatewayID",
      "Value": "17007",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 49,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "gatewayID",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    },
    {
      "AttributeId": 527,
      "Name": "desc",
      "Value": "Second Bay",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 50,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "desc",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    },
    {
      "AttributeId": 536,
      "Name": "doorstate",
      "Value": "2",
      "UpdatedTime": "1479595818080",
      "MyQDeviceTypeAttributeId": 56,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "doorstate",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-11-19T22:50:18.0801099Z"
    },
    {
      "AttributeId": 596,
      "Name": "addedtime",
      "Value": "1471505595777",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 61,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "addedtime",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    },
    {
      "AttributeId": -1,
      "Name": "isunattendedopenallowed",
      "Value": "1",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 77,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "isunattendedopenallowed",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    },
    {
      "AttributeId": -1,
      "Name": "isunattendedcloseallowed",
      "Value": "1",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 78,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "isunattendedcloseallowed",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    },
    {
      "AttributeId": -1,
      "Name": "name",
      "Value": "CG0839C",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 87,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "name",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    },
    {
      "AttributeId": -1,
      "Name": "customerName",
      "Value": "CG0839C",
      "UpdatedTime": "1471505595777",
      "MyQDeviceTypeAttributeId": 75,
      "IsDeviceProperty": false,
      "AttributeDisplayName": "customerName",
      "IsPersistent": false,
      "IsTimeSeries": false,
      "IsGlobal": false,
      "UpdatedDate": "2016-08-18T02:33:15.777"
    }
  ],
  "ChildrenMyQDeviceIds": "",
  "UpdatedBy": "System",
  "UpdatedDate": "2016-08-18T02:33:15.777"
},

I have my HA running HASSbian Image for Raspberry Pi
and I was trying to get myq to work. it works directly in Wink but not via HA. So I wanted to enable the custom cover
So I am getting this error:
Testing configuration at /home/homeassistant/.homeassistant
16-11-29 20:27:08 ERROR (MainThread) [homeassistant.loader] Unable to find component cover.myq
16-11-29 20:27:08 ERROR (MainThread) [homeassistant.bootstrap] Unable to find platform cover.myq
Failed config
General Errors:
- Platform not found: cover.myq

Any thoughts?

Successful config (partial)

MyQ isn’t an official component yet. You’ll need to install it manually - check back through the thread for instructions.

1 Like

Howdy, just read this entire thread. Good stuff.

Okay I just got started trying to add my Liftmaster doors to HA. I got what i could tell is the latest copy of myq.py from here https://raw.githubusercontent.com/arraylabs/myq/master/myq.py.

However like @halpplz I too used the AIO installer and this is what have:

 /home/hass/.homeassistant/deps/cover

under the .homeassistant dir there is no custom_components dir. Is this something that i need to create manually? or do i put the cover dir in the deps dir?

well I went with adding cover to deps and got this as my error in the logs:

16-12-07 05:51:08 homeassistant.loader: Unable to find component cover.myq
16-12-07 05:51:08 homeassistant.bootstrap: Unable to find platform cover.myq

So obviously it isnt finding it but i want to ensure i dont screw something up before i go adding new folders all over the place.

Thanks

@efighter

the path for it is /home/hass/.homeassistant/custom_components

You need to put the custom components folder inside of the homeassistant folder (where configuration.yaml resides), not inside of deps

1 Like

My chamberlain garage door opener was added to HASs through the wink hub. Are there any added benefits by adding the custome component on its own? Added functionality?

@halpplz

Thanks, for that. I created the dir custom_components and moved the cover/myq.py and it worked without needing to change anything in the script. already tested it out going up and down like a champ!

  • Liftmaster 8550
  • Liftmaster internet gateway 828LM
  • I have two doors and both show up with the names i have in the app
  • I used the script exactly as is on this page on the date of this post https://raw.githubusercontent.com/arraylabs/myq/master/myq.py
  • I am running the AIO installer and had to manually create the custom_components dir to place the cover/myq.py within

HTH anyone setting up in the future.

Thanks to all who have blazed this trail and gotten this component where it is today.

2 Likes

Awesome,
Now I have the wink doors and the HA doors. How do I tell which one is which? Will this accept customizations to allow for renaming the doors in HA?

several users have posted this above.

although i didnt need it since the script was able to read my names from MyQ. This is how you would do it.

Yea, the main problem was figuring out which was which. I have two doors, so when I loaded this, I had 4 covers showing up, two with single_door for a name and two with two_door for a name. The _2 at the end didn’t really help tell me which one was which. So I renamed one set and then tried to see which one opened the door and which ones were from Wink and just showed the status. Got it now. On to other problems. :slight_smile:
Thanks for chasing this down. It made it much easier for me to get it working.

For anyone interested, if you use the following in your Wink config you will be able to control your garage door. The limitation was put in place by Wink at the request of Chamberlain to restrict control of third party applications. By using the following client_id and client_secret all requests going to the Wink API will appear to be coming form the official Wink Android application.

*Note: Wink could make a change at any time to “break” this.

    client_id: quirky_wink_android_app
    client_secret: e749124ad386a5a35c0ab554a4f2c045
2 Likes

The component should use the name you have configured in the MyQ app, change it there and it should update the next time you restart HA.

Hi folks,
I found an easy way to integrate liftmaster with homeassistant. Assuming you have the Liftmaster Internet bridge and have configured it on the liftmaster site with a username and password, you can use this simple but awesome program(https://github.com/Einstein42/myq-garage/) by Einstein42 to connect to home assistant. No need to dabble with wink or suffer the grief described here. Here is a brief summary of what I did.

  1. Install the program code as described on the link on your home assistant server.
  2. Configure the username and password in config.ini. NOTE: Leave the brand as Chamberlin. (Do not change it to Liftmaster)
  3. Test the program. You should be able to run the command

myq-garage.py status

to get the ID of your garage door and

myq-garage.py start
myq-garage.py stop
4. Now add the following configuration to your YAML

cover:

  • platform: command_line
    covers:
    garage_door:
    friendly_name: Garage Door myq-garage
    command_open: /myq-garage.py open
    command_close: /myq-garage.py close
    command_state: /myq-garage.py status | awk ‘{print $5}’
    value_template: >
    {% if value == ‘Open.’ %}
    100
    {% else %}
    0
    {% endif %}
  1. Reboot and test. You should now be able to work your liftmaster garage door with HomeAssistant.

Special thanks to James Milne (https://github.com/Einstein42) for this awesome program. Hope this help all of you.

1 Like

Great job rajivram! I have followed your steps, but cannot get Home Assistant to locate the may-garage.py app. It works in terminal to open and close the doors, but gives me the message: “/bin/sh: 1: /myq-garage.py: not found”. I’ve searched the Home Assistant docs, but can’t seem to find a reference to where the .py files are to be located. I am using the (homeassistant_venv) installation. Thanks for any help you can provide!

Apologies. My bad. Please include the whole absolute path to your myq-garage(The path where you installed myq-garage on your system). These are my commands.

/home/rajivram/myq-garage/myq-garage.py open “My Garage Door”
/home/rajivram/myq-garage/myq-garage.py close “My Garage Door”
/home/rajivram/myq-garage/myq-garage.py status | awk ‘{print $5}’

Thanks for setting me straight! I am just getting started with hass and am trying to find my way around.

@rajivram I’m trying to set up this command_line cover as you’ve laid out. I can get everything working from the command line in the location where I’ve configured the script (/home/pi/myq-garage), but I seem to need to run it like sudo python /home/pi/myq-garage/myq-garage.py open "Garage Door Opener" for it to work. This does not however seem to work in hass, as nothing happens. I get the following error in hass:

homeassistant.components.cover.command_line: Command failed: sudo python /home/pi/myq-garage/myq-garage.py open "Garage Door Opener"

This is my config:

cover:
  - platform: command_line
    covers:
      garage_door:
        friendly_name: Garage Door myq-garage
        command_open: sudo python /home/pi/myq-garage/myq-garage.py open "Garage Door Opener"
        command_close: sudo python /home/pi/myq-garage/myq-garage.py close "Garage Door Opener"
        command_state: sudo python /home/pi/myq-garage/myq-garage.py status | awk '{print $5}' 
        value_template: >
          {% if value == 'Open.' %}
          100
          {% else %}
          0
          {% endif %}