Chamberlain MyQ Binding

I just started experimenting with OpenHAB, and the first thing I got working was my Garage Door! :slightly_smiling: FYI, I ā€œretrofittedā€ my <15 year old opener with a MyQ 888LM Control Panel + 828LM Gateway. So you can add that setup to the list of supported devices.

However, I also have a MyQ 823LM Remote Light Switch. How can I get that to work as well?

myq=ā€œ0ā€ works for garage switch.
Switch GarageDoorSwitch "Garage [%s]" <garagedoor> (Garage) {myq="0"}

So, I assumed the light switch would be myq=ā€œ1ā€.
Switch MasterBedLightSwitch "Bedroom Lights [%s]" <switch> (Bedrooms, Lights) {myq="1"}

Here is the console output when I tried to turn the switch on:
2016-01-26 09:15:58.258 [INFO ] [runtime.busevents ] - MasterBedLightSwitch received command ON 2016-01-26 09:15:58.462 [WARN ] [inding.myq.internal.MyqBinding] - no MyQ device found with index: 1

Am I missing something, or are the light switch modules ([823LM](https://www.liftmaster.com/for-homes/Accessories/MyQ-Accessories/model-823LM-(1) & 825LM) not supportedā€¦ yet? :wink:

I am a former website developer, and while I havenā€™t worked with Java, I have learned enough languages over the years that I might be able to contribute. How can help add support for the MyQ switches?

Hi Brian, I was wondering when someone would ask about the remote light
switch support. Its not implemented, mostly b/c no one asked for it :wink:
Can you run OH in debug mode (start_debug.sh/bat) and print out the big
JSON blob that the myq binding gets back from the Chamerlain api? Probably
not hard to put in.

On Tue, Jan 26, 2016 at 9:40 AM Brian Hanifin bot@community.openhab.org wrote:

BrianHanifin https://community.openhab.org/users/brianhanifin
January 26

I just started experimenting with OpenHAB, and the first thing I got
working was my Garage Door! [image: :slightly_smiling:] FYI, I
ā€œretrofittedā€ my <15 year old opener with a MyQ 888LM Control Panel
https://www.liftmaster.com/for-homes/Accessories/MyQ-Accessories/model-888LM

However, I also have a MyQ 823LM Remote Light Switch
https://www.liftmaster.com/for-homes/Accessories/MyQ-Accessories/model-823LM-(1).
How can I get that to work as well?

myq=ā€œ0ā€ works for garage switch.
Switch GarageDoorSwitch ā€œGarage [%s]ā€ (Garage) {myq=ā€œ0ā€}

So, I assumed the light switch would be myq=ā€œ1ā€.
Switch MasterBedLightSwitch ā€œBedroom Lights [%s]ā€ (Bedrooms,
Lights) {myq=ā€œ1ā€}

Here is the console output when I tried to turn the switch on:
2016-01-26 09:15:58.258 [INFO ] [runtime.busevents ] -
MasterBedLightSwitch received command ON
2016-01-26 09:15:58.462 [WARN ] [inding.myq.internal.MyqBinding] - no MyQ
device found with index: 1

Am I missing something, or are the light switch modules (823LM
https://www.liftmaster.com/for-homes/Accessories/MyQ-Accessories/model-823LM-(1
& 825LM
https://www.liftmaster.com/for-homes/Accessories/MyQ-Accessories/model-825LM-(1))
not supportedā€¦ yet? [image: :wink:]

I am a former website developer, and while I havenā€™t worked with Java, I
have learned enough languages over the years that I might be able to
contribute. How can help add support for the MyQ switches?

Visit Topic
https://community.openhab.org/t/chamberlain-myq-binding/4192/41 or
reply to this email to respond.

To stop receiving notifications for this particular topic, click here
https://community.openhab.org/t/chamberlain-myq-binding/4192/unsubscribe.
To unsubscribe from these emails, change your user preferences
https://community.openhab.org/my/preferences

ā€“
Sent from my mobile.

You also need to change the logger level to trace for the JSON data to be shown.

<logger name="org.openhab.binding.myq" level="TRACE" />

@scooter_seh maybe your right and we should change that to debug by default :wink:

Does this help?

http://pastebin.com/SmeRz7L1

Yep, thats it. @scooter_seh I had kinda looked at implementing this which is why I was curious for the json dump. I figure you probably have this :wink: , if not or too busy, let me know I would be happy to help!

  {
      "MyQDeviceId": 909105,
      "ParentMyQDeviceId": 871072,
      "MyQDeviceTypeId": 3,
      "MyQDeviceTypeName": "LampModule",
      "RegistrationDateTime": "2014-09-22T23:53:54.09",
      "SerialNumber": "CG0670811DAA",
      "UserName": "..........",
      "UserCountryId": 0,
      "Attributes": [
        {
          "MyQDeviceTypeAttributeId": 135,
          "Value": "True",
          "UpdatedTime": "1411448034090",
          "IsDeviceProperty": false,
          "AttributeDisplayName": "online",
          "IsPersistent": false,
          "IsTimeSeries": false,
          "IsGlobal": false,
          "UpdatedDate": "2014-09-22T23:53:54.09"
        },
        {
          "MyQDeviceTypeAttributeId": 14,
          "Value": "201447270",
          "UpdatedTime": "1411448034090",
          "IsDeviceProperty": false,
          "AttributeDisplayName": "gatewayID",
          "IsPersistent": false,
          "IsTimeSeries": false,
          "IsGlobal": false,
          "UpdatedDate": "2014-09-22T23:53:54.09"
        },
        {
          "MyQDeviceTypeAttributeId": 21,
          "Value": "Bedroom",
          "UpdatedTime": "1411448034090",
          "IsDeviceProperty": false,
          "AttributeDisplayName": "desc",
          "IsPersistent": false,
          "IsTimeSeries": false,
          "IsGlobal": false,
          "UpdatedDate": "2014-09-22T23:53:54.09"
        },
        {
          "MyQDeviceTypeAttributeId": 8,
          "Value": "0",
          "UpdatedTime": "1453821839165",
          "IsDeviceProperty": false,
          "AttributeDisplayName": "lightstate",
          "IsPersistent": false,
          "IsTimeSeries": false,
          "IsGlobal": false,
          "UpdatedDate": "2016-01-26T15:23:59.1650846Z"
        },
        {
          "MyQDeviceTypeAttributeId": 15,
          "Value": "1411448034090",
          "UpdatedTime": "1411448034090",
          "IsDeviceProperty": false,
          "AttributeDisplayName": "addedtime",
          "IsPersistent": false,
          "IsTimeSeries": false,
          "IsGlobal": false,
          "UpdatedDate": "2014-09-22T23:53:54.09"
        },
        {
          "MyQDeviceTypeAttributeId": 98,
          "Value": "CG0670811DAA",
          "UpdatedTime": "1411448034090",
          "IsDeviceProperty": false,
          "AttributeDisplayName": "name",
          "IsPersistent": false,
          "IsTimeSeries": false,
          "IsGlobal": false,
          "UpdatedDate": "2014-09-22T23:53:54.09"
        },
        {
          "MyQDeviceTypeAttributeId": 13,
          "Value": "CG0670811DAA",
          "UpdatedTime": "1411448034090",
          "IsDeviceProperty": false,
          "AttributeDisplayName": "customerName",
          "IsPersistent": false,
          "IsTimeSeries": false,
          "IsGlobal": false,
          "UpdatedDate": "2014-09-22T23:53:54.09"
        }
      ],
      "ChildrenMyQDeviceIds": "",
      "UpdatedBy": "System",
      "UpdatedDate": "2014-09-22T23:53:54.09",
      "ConnectServerDeviceId": "234883416"
    }

@digitaldan I donā€™t know if I should make a new lamp class and have two linked lists for each device type which would also mean I need to add something to the configuration parser to select the different device types. Option two would be to make the current GarageDoorData class more generic to support both device types and ā€œdoorstateā€, ā€œlightstateā€ parameters and keep the current config setup. Iā€™m leaning towards option two but I wanted your opinion on it. Thanks.

I would refactor the GarageDoorDevice to be something like MyqDevice, and then have a GarageDoorDevice and and a LightDevice as classes who inherit from MyqDevice. When you get a MyqDevice out of the linked list you can check what type it is with
``
`MyqDevice d = getDevice(int index);
if(d instanceof GarageDoorDevice){
GarageDoorDevice gd = (GarageDoorDevice)d;
ā€¦
}
}```

I donā€™t think a lot else has to change, but I have not looked in depth at it.

Thanks for your MyQ work.

My MyQ also has:
garage motion sensor that turns on the openerā€™s light
garage temperature

The motion sensor would be nice to integrate to both:
ā€œWeā€™re homeā€ light scenarios and security scenarios (should not be motion when Iā€™m on vacation).

Do all of them have this or is it different by model.

Should I try that trace thing?

1 Like

Jeff, I like that idea. I could use something like:

If Nest Status is set to Away and MyQ Senses Movement, turn on the light by the garage door! :slightly_smiling:

It would also be interesting to see the range of temperatures my garage goes through.
In northern Illinois our garage is typically around 40 in winter and 90ā€™s in summer but sees some days below freezing and others 100+

Iā€™m an openhab newbie as well. Is it possible to access any of the other attributes like device name with openhab? Iā€™m not sure what the item binding format would look like. Otherwise, great binding! Thank you for the hard work!. I also have two homes or two places on the same account. Even though I can see both places in the logs, I can only seem to access the first place that shows up.

-Lee

You should be able to change the configuration value in your items definitions to use the second opener.

Switch GarageDoorSwitch2 "Garage Door Opener 2" {myq="1"}

Thanks Scott, Iā€™ve tried that. This is what I get
myq=0 - first garage door in first location
myq=1 - second garage door in first location
myq=2 - I get nothing
myq=3 - I get nothing
myq=4 - I get nothing

I have two garage doors in the first location and three garage doors in the second home.

My opener has the motion sensor/temperature wall remote and the values do not appear in the MyQ API.

Add this line to your logback.xml.

<logger name="org.openhab.binding.myq" level="TRACE" />

Then in your log there will be some lines starting with ā€œReceived MyQ JSON:ā€ If you could send me the JSON I can look into what is happening. Some of the JSON statements will be you login token (not what I need) and there should be a larger statement with the opener status which is what I want to look at.

Dang, thanks for letting us know that motion and temperature doesnā€™t seem to be in the API.
Iā€™ll try you logging suggestion.

Here you go Scott. I hope this is what youā€™re looking for.

http://pastebin.com/EJ3uy9Tt

Riches looks nicer than mine - not sure why.

2016-02-11 12:59:19.820 [TRACE] [o.binding.myq.internal.MyqData] - Received MyQ JSON:
{"Devices":[{"MyQDeviceId":477896,"MyQDeviceTypeId":1,"MyQDeviceTypeName":"Gateway","RegistrationDateTime":"2014-07-21T02:12:53.387","SerialNumber":"ABC123","UserName":"your.name@gmail.com","UserCountryId":0,"Attributes":[{"MyQDeviceTypeAttributeId":135,"Value":"True","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"online","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":1,"Value":"0","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"enumeraterequired","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":3,"Value":"0","UpdatedTime":"1455130401745","IsDeviceProperty":false,"AttributeDisplayName":"learnmodestate","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":6,"Value":"2014-07-21 02:12:53","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"addedtime","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":25,"Value":"201863892","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"devices","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":26,"Value":"1","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"numdevices","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":28,"Value":"Home","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"desc","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":33,"Value":"4.2","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"fwver","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":95,"Value":"ABC123","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"name","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":104,"Value":"ABC123","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"deviceName","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":4,"Value":"ABC123","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"customerName","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":438,"Value":"False","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"HomeKitCapable","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":439,"Value":"False","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"HomeKitEnabled","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":440,"Value":"True","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"IsFirmwareCurrent","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":441,"Value":"False","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"HomeKitFactorySeededSetupCode","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"}],"ChildrenMyQDeviceIds":"999901","UpdatedBy":"System","UpdatedDate":"2014-07-21T02:12:53.387","ConnectServerDeviceId":"240627"},{"MyQDeviceId":999901,"ParentMyQDeviceId":477896,"MyQDeviceTypeId":2,"MyQDeviceTypeName":"GarageDoorOpener","RegistrationDateTime":"2014-07-21T02:12:53.387","SerialNumber":"CG0810146875","UserName":"your.name@gmail.com","UserCountryId":0,"Attributes":[{"MyQDeviceTypeAttributeId":135,"Value":"True","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"online","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":49,"Value":"240627","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"gatewayID","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":50,"Value":"Garage Door Opener","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"desc","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":56,"Value":"2","UpdatedTime":"1455216818635","IsDeviceProperty":false,"AttributeDisplayName":"doorstate","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2016-02-11T18:53:38.6346918Z"},{"MyQDeviceTypeAttributeId":61,"Value":"1405926773387","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"addedtime","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":77,"Value":"1","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"isunattendedopenallowed","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":78,"Value":"1","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"isunattendedcloseallowed","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":87,"Value":"CG0810146875","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"name","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"},{"MyQDeviceTypeAttributeId":75,"Value":"CG0810146875","UpdatedTime":"1405926773387","IsDeviceProperty":false,"AttributeDisplayName":"customerName","IsPersistent":false,"IsTimeSeries":false,"IsGlobal":false,"UpdatedDate":"2014-07-21T02:12:53.387"}],"ChildrenMyQDeviceIds":"","UpdatedBy":"System","UpdatedDate":"2014-07-21T02:12:53.387","ConnectServerDeviceId":"201863892"}],"ReturnCode":"0","ErrorMessage":"","CorrelationId":"4e88c03b-0882-44e7-8eb6-8833f7b204ce"}

I fed my output through a JSON editor before posting so it would be easier to read.