MyQ Plugin - BETA

User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
chase
Posts: 75
Joined: Sun Oct 27, 2013 8:37 am

Re: MyQ Plugin - BETA

Post by chase »

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.
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
chase
Posts: 75
Joined: Sun Oct 27, 2013 8:37 am

Re: MyQ Plugin - BETA

Post by chase »

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
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
chase
Posts: 75
Joined: Sun Oct 27, 2013 8:37 am

Re: MyQ Plugin - BETA

Post by chase »

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?
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
chase
Posts: 75
Joined: Sun Oct 27, 2013 8:37 am

Re: MyQ Plugin - BETA

Post by chase »

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='')
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
chase
Posts: 75
Joined: Sun Oct 27, 2013 8:37 am

Re: MyQ Plugin - BETA

Post by chase »

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
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
chase
Posts: 75
Joined: Sun Oct 27, 2013 8:37 am

Re: MyQ Plugin - BETA

Post by chase »

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
gskarp
Posts: 156
Joined: Thu Apr 19, 2012 4:50 pm

Re: MyQ Plugin - BETA

Post by gskarp »

BTW, this is working great for me. Thanks!
User avatar
FlyingDiver
Posts: 7823
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: MyQ Plugin - BETA

Post by FlyingDiver »

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
Locked

Return to “MyQ”