MyQ Plugin - BETA

Posted on
Wed Jun 15, 2016 11:56 am
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Indigo is running Python 2.6, so you need to make sure you have requests installed where 2.6 will see it.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jun 15, 2016 9:56 pm
chase offline
Posts: 75
Joined: Oct 27, 2013

Re: MyQ Plugin - BETA

I am getting similar errors... Here is the log..

Code: Select all
 MyQ Error                       plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
  MyQ Debug                       myqLogin: Success, Brand = Liftmaster, SecurityToken = 1eae7023-1d9a-4bde-97a5-3d64898a2f80
  MyQ Debug                       getDoors: 6 Devices
  MyQ Debug                       getDoors: MyQDeviceTypeId = 1, DeviceId = 1700000428
  MyQ Debug                       getDoors: MyQDeviceTypeId = 3, DeviceId = 1700000433
  MyQ Debug                       getDoors: MyQDeviceTypeId = 3, DeviceId = 1700000431
  MyQ Debug                       getDoors: MyQDeviceTypeId = 3, DeviceId = 1700000432
  MyQ Debug                       getDoors: MyQDeviceTypeId = 2, DeviceId = 1700000430
  MyQ Debug                       getDoors: Garage Door Opener (1700000430), state = 2
  MyQ Debug                       getDoors: MyQDeviceTypeId = 2, DeviceId = 1700000429
  MyQ Debug                       getDoors: Garage Door Opener (1700000429), state = 2
  MyQ Error                       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 112, in runConcurrentThread
  File "plugin.py", line 303, in getDoors
ValueError: NameNotUniqueError



I have 2 openers, but only one is reported in the device window. The door opener is listed in the state of 'Closed'....

I don't see any control buttons for the opener (Open, Close)

I have some MyQ lightswitches and a plug in switch that would be cool to add.

Posted on
Wed Jun 15, 2016 10:09 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

It appears you have both your openers named the same in the MyQ app. I wrote the code assuming that everything would have unique names. Silly me. In the short term, use the MyQ app to rename one of the openers.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jun 15, 2016 10:23 pm
chase offline
Posts: 75
Joined: Oct 27, 2013

Re: MyQ Plugin - BETA

Giving the doors unique names eliminated the errors in the log.

But the door names on the devices are not getting updated (i.e. I mislabeled the double door and the single door, then corrected them and the device names are not getting updated).

Also the Devices still have no control buttons. Is this yet to be implemented?

Its coming along... :D

Posted on
Thu Jun 16, 2016 5:30 am
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

chase wrote:
But the door names on the devices are not getting updated (i.e. I mislabeled the double door and the single door, then corrected them and the device names are not getting updated).


The plugin only sets the names when it initially creates the devices. After that, you can edit the Indigo names any way you want, it won't overwrite them with the MyQ names.

Also the Devices still have no control buttons. Is this yet to be implemented?


Maybe. Right now, the MyQ devices are custom devices, not relay devices. So there's no On/Off buttons. You use Actions to Open or Close the door.

I did it that way because the doors have more states than just On or Off. If it's stopped part way open, MyQ reports is as "Stopped". If it's in motion, MyQ reports that as well.

I can see arguments either way. Anyone else have a preference on the device type?

I have some MyQ lightswitches and a plug in switch that would be cool to add.


I see three MyQDeviceTypeId = 3 in the log snippet you posted. Do you have three lights? I'll see about adding support for those.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jun 16, 2016 9:48 am
chase offline
Posts: 75
Joined: Oct 27, 2013

Re: MyQ Plugin - BETA

Yes, I have 3 lights... It seems MyQ lumps the physical types all under the one type (I have 2 decora type wall switches and 1 wall wart switch).

The MyQ apps seem to push alerts and door state changes... are these available thru the api?

Posted on
Thu Jun 16, 2016 9:52 am
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

chase wrote:
Yes, I have 3 lights... It seems MyQ lumps the physical types all under the one type (I have 2 decora type wall switches and 1 wall wart switch).

The MyQ apps seem to push alerts and door state changes... are these available thru the api?


Remember, this is an unofficial reverse engineered API. As far as I can tell, there's no way to get push notifications. I have to poll for state changes.

Since I don't have any of those switch devices, I'm putting some extra code in the next release to gather info I'll need to (hopefully) support them.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jun 18, 2016 3:45 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

V0.0.4 available.

MyQ devices are now Relay devices, so On/Off is available in the Indigo UI. Please edit devices to pick up the change. You might need to delete them and let the plugin recreate them.

Initial support for MyQ switches. I don't have any of these, so it's just a guess. I need to see the debug output from a Device Update call to see what the states are reported as. If possible, have different switches on and off for the debug log.

Did some fixes to state reporting.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jun 18, 2016 4:11 pm
chase offline
Posts: 75
Joined: Oct 27, 2013

Re: MyQ Plugin - BETA

Here is my debug log for v0.4

Code: Select all

 MyQ Debug                       myqLogin: Success, Brand = Liftmaster, SecurityToken = 676c41d5-ab90-4e8c-afdd-ae81211e9fe7
  MyQ Debug                       getDevices: 6 Devices
  MyQ Debug                       getDevices: MyQDeviceTypeId = 1, DeviceId = 1700000428
  MyQ Debug                       getDevices: MyQDeviceTypeId = 3, DeviceId = 1700000433
  MyQ Debug                       getDeviceState: Bad return code: Error processing request (217)
  MyQ Debug                       getDevices: Switch = Plug in Light Module (1700000433), state = 0
  MyQ Error                       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 107, in runConcurrentThread
  File "plugin.py", line 343, in getDevices
ArgumentError: Python argument types in
    DeviceList.iter(DeviceList, Plugin)
did not match C++ signature:
    iter(TCList_onDemandClient<CDeviceWrapper>, CCString filter='')

Posted on
Sat Jun 18, 2016 4:39 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

OK, that bad return code line is what we need to figure out to get lights working.

Try this version: https://github.com/FlyingDiver/Indigo-M ... tag/v0.0.5

The ArgumentError is my fault and should be fixed now.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jun 18, 2016 7:04 pm
chase offline
Posts: 75
Joined: Oct 27, 2013

Re: MyQ Plugin - BETA

Here is my debug log for v 0.50 :)

Code: Select all
 MyQ Debug                       myqLogin: Success, Brand = Liftmaster, SecurityToken = d94d5981-6f83-4e07-82e2-083c9e3795ff
  MyQ Debug                       getDevices: 6 Devices
  MyQ Debug                       getDevices: MyQDeviceTypeId = 1, DeviceId = 1700000428
  MyQ Debug                       getDevices: MyQDeviceTypeId = 3, DeviceId = 1700000433
  MyQ Debug                       getDevices: Switch = Plug in Light Module (1700000433), data = {u'UserName': u'my@email.com', u'MyQDeviceTypeId': 3, u'Attributes': [{u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'online', u'IsGlobal': False, u'Value': u'True', u'MyQDeviceTypeAttributeId': 135, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 4614, u'IsTimeSeries': False, u'AttributeDisplayName': u'online', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'gatewayID', u'IsGlobal': False, u'Value': u'1700000428', u'MyQDeviceTypeAttributeId': 14, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 574, u'IsTimeSeries': False, u'AttributeDisplayName': u'gatewayID', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'desc', u'IsGlobal': False, u'Value': u'Plug in Light Module', u'MyQDeviceTypeAttributeId': 21, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 528, u'IsTimeSeries': False, u'AttributeDisplayName': u'desc', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1442182565764', u'IsPersistent': False, u'Name': u'lightstate', u'IsGlobal': False, u'Value': u'0', u'MyQDeviceTypeAttributeId': 8, u'UpdatedDate': u'2015-09-13T22:16:05.7639437Z', u'AttributeId': 552, u'IsTimeSeries': False, u'AttributeDisplayName': u'lightstate', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'addedtime', u'IsGlobal': False, u'Value': u'1433531344607', u'MyQDeviceTypeAttributeId': 15, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 601, u'IsTimeSeries': False, u'AttributeDisplayName': u'addedtime', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'name', u'IsGlobal': False, u'Value': u'CG0670000EF3', u'MyQDeviceTypeAttributeId': 98, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': -1, u'IsTimeSeries': False, u'AttributeDisplayName': u'name', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'customerName', u'IsGlobal': False, u'Value': u'CG0670000EF3', u'MyQDeviceTypeAttributeId': 13, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': -1, u'IsTimeSeries': False, u'AttributeDisplayName': u'customerName', u'IsDeviceProperty': False}], u'DeviceName': u'CG0670000EF3', u'UserConnectServerId': 1, u'SerialNumber': u'CG0670000EF3', u'MyQDeviceId': 1550599, u'RegistrationDateTime': u'2015-06-05T14:09:04.607', u'TypeName': u'Light', u'UpdatedDate': u'2015-06-05T14:09:04.607', u'UpdatedBy': u'System', u'ChildrenMyQDeviceIds': u'', u'DeviceId': u'1700000433', u'ParentMyQDeviceId': 1550598, u'TypeId': 48, u'MyQDeviceTypeName': u'LampModule', u'UserCountryId': 0}
  MyQ Debug                       getDevices: MyQDeviceTypeId = 3, DeviceId = 1700000431
  MyQ Debug                       getDevices: Switch = Double Bay Light (1700000431), data = {u'UserName': u'my@email.com', u'MyQDeviceTypeId': 3, u'Attributes': [{u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'online', u'IsGlobal': False, u'Value': u'True', u'MyQDeviceTypeAttributeId': 135, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 4614, u'IsTimeSeries': False, u'AttributeDisplayName': u'online', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'gatewayID', u'IsGlobal': False, u'Value': u'1700000428', u'MyQDeviceTypeAttributeId': 14, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 574, u'IsTimeSeries': False, u'AttributeDisplayName': u'gatewayID', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'desc', u'IsGlobal': False, u'Value': u'Double Bay Light', u'MyQDeviceTypeAttributeId': 21, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 528, u'IsTimeSeries': False, u'AttributeDisplayName': u'desc', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1466295318693', u'IsPersistent': False, u'Name': u'lightstate', u'IsGlobal': False, u'Value': u'0', u'MyQDeviceTypeAttributeId': 8, u'UpdatedDate': u'2016-06-19T00:15:18.6925418Z', u'AttributeId': 552, u'IsTimeSeries': False, u'AttributeDisplayName': u'lightstate', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'addedtime', u'IsGlobal': False, u'Value': u'1433531344607', u'MyQDeviceTypeAttributeId': 15, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 601, u'IsTimeSeries': False, u'AttributeDisplayName': u'addedtime', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'name', u'IsGlobal': False, u'Value': u'CG067080870D', u'MyQDeviceTypeAttributeId': 98, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': -1, u'IsTimeSeries': False, u'AttributeDisplayName': u'name', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'customerName', u'IsGlobal': False, u'Value': u'CG067080870D', u'MyQDeviceTypeAttributeId': 13, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': -1, u'IsTimeSeries': False, u'AttributeDisplayName': u'customerName', u'IsDeviceProperty': False}], u'DeviceName': u'CG067080870D', u'UserConnectServerId': 1, u'SerialNumber': u'CG067080870D', u'MyQDeviceId': 1550600, u'RegistrationDateTime': u'2015-06-05T14:09:04.607', u'TypeName': u'Light', u'UpdatedDate': u'2015-06-05T14:09:04.607', u'UpdatedBy': u'System', u'ChildrenMyQDeviceIds': u'', u'DeviceId': u'1700000431', u'ParentMyQDeviceId': 1550598, u'TypeId': 48, u'MyQDeviceTypeName': u'LampModule', u'UserCountryId': 0}
  MyQ Debug                       getDevices: MyQDeviceTypeId = 3, DeviceId = 1700000432
  MyQ Debug                       getDevices: Switch = Single Bay Light (1700000432), data = {u'UserName': u'my@email.com', u'MyQDeviceTypeId': 3, u'Attributes': [{u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'online', u'IsGlobal': False, u'Value': u'True', u'MyQDeviceTypeAttributeId': 135, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 4614, u'IsTimeSeries': False, u'AttributeDisplayName': u'online', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'gatewayID', u'IsGlobal': False, u'Value': u'1700000428', u'MyQDeviceTypeAttributeId': 14, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 574, u'IsTimeSeries': False, u'AttributeDisplayName': u'gatewayID', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'desc', u'IsGlobal': False, u'Value': u'Single Bay Light', u'MyQDeviceTypeAttributeId': 21, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 528, u'IsTimeSeries': False, u'AttributeDisplayName': u'desc', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1466293924998', u'IsPersistent': False, u'Name': u'lightstate', u'IsGlobal': False, u'Value': u'1', u'MyQDeviceTypeAttributeId': 8, u'UpdatedDate': u'2016-06-18T23:52:04.9978258Z', u'AttributeId': 552, u'IsTimeSeries': False, u'AttributeDisplayName': u'lightstate', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'addedtime', u'IsGlobal': False, u'Value': u'1433531344607', u'MyQDeviceTypeAttributeId': 15, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': 601, u'IsTimeSeries': False, u'AttributeDisplayName': u'addedtime', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'name', u'IsGlobal': False, u'Value': u'CG067080895D', u'MyQDeviceTypeAttributeId': 98, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': -1, u'IsTimeSeries': False, u'AttributeDisplayName': u'name', u'IsDeviceProperty': False}, {u'UpdatedTime': u'1433531344607', u'IsPersistent': False, u'Name': u'customerName', u'IsGlobal': False, u'Value': u'CG067080895D', u'MyQDeviceTypeAttributeId': 13, u'UpdatedDate': u'2015-06-05T14:09:04.607', u'AttributeId': -1, u'IsTimeSeries': False, u'AttributeDisplayName': u'customerName', u'IsDeviceProperty': False}], u'DeviceName': u'CG067080895D', u'UserConnectServerId': 1, u'SerialNumber': u'CG067080895D', u'MyQDeviceId': 1550601, u'RegistrationDateTime': u'2015-06-05T14:09:04.607', u'TypeName': u'Light', u'UpdatedDate': u'2015-06-05T14:09:04.607', u'UpdatedBy': u'System', u'ChildrenMyQDeviceIds': u'', u'DeviceId': u'1700000432', u'ParentMyQDeviceId': 1550598, u'TypeId': 48, u'MyQDeviceTypeName': u'LampModule', u'UserCountryId': 0}
  MyQ Debug                       getDevices: MyQDeviceTypeId = 2, DeviceId = 1700000430
  MyQ Debug                       getDevices: Opener = Single Garage Door Opener (1700000430), state = 7
  MyQ Error                       Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 107, in runConcurrentThread
  File "plugin.py", line 320, in getDevices
IndexError: list index out of range

Posted on
Sat Jun 18, 2016 7:56 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Hmm. Nothing useful in that data dump, unfortunately. It's getting the device data fine, and the name, but the device state API call that works for openers doesn't work for switches. Unless I can find info somewhere on the net on what the API calls are for switches, I think we're out of luck.

Also concerning is that you appeared to get a state = 7 for one of your openers, and that's not listed as a possible state. Are the openers working normally? I put in a test for out of range state values, so that'll prevent that error if it happens again.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jun 18, 2016 10:21 pm
chase offline
Posts: 75
Joined: Oct 27, 2013

Re: MyQ Plugin - BETA

Joe

The one opener was unplugged, so I guess that is state 7..... lol

I am getting no more errors with the opener plugged in... the openers states are reported correctly....

Thanks

Posted on
Wed Jun 22, 2016 12:25 pm
gskarp offline
Posts: 143
Joined: Apr 19, 2012

Re: MyQ Plugin - BETA

BTW, this is working great for me. Thanks!

Posted on
Wed Jun 22, 2016 12:27 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

gskarp wrote:
BTW, this is working great for me. Thanks!


Good to know.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Who is online

Users browsing this forum: No registered users and 3 guests