arraylabs / pymyq

Python wrapper for MyQ API
MIT License
112 stars 42 forks source link

Testing request for lamps #81

Closed ehendrix23 closed 3 years ago

ehendrix23 commented 3 years ago

All,

There is a new test update for pymyq (v3.1.0b1) in which I re-arranged how accounts and devices are stored to better support multiple MyQ accounts for 1 ID.

In addition, I updated the MyQ HASS component to include lights. I do not have any MyQ lights so I need folks to test this.

Easiest is by leveraging HACS to install the custom component. Following the instructions on Installation with HACS mentioned here: https://github.com/ehendrix23/hass_myq Once MyQ is installed from HACS and you restart HASS, go back to HACS -> Integrations, find the MyQ card and click on the 3 dots there. Click Reinstall. Now enable "Show beta versions" and then select version v1.0.0b1. Another restart is then required.

That will deploy the new MyQ component that includes support for lights. Use this issue to report problems, success, ...

Also, if someone could enable debug in the logger component of HASS for: pymyq.request: debug and then send me the debug for the request going to: https://devices.myq-cloud.com/api/v5.2/Accounts

The response would be device information. Especially looking what is being returned for lamps.

Thank you.

@SConaway @FlyingDiver @brbeaird @garyak @GaryOkie @ds7771

garyak commented 3 years ago

No lamps, but:

2021-02-11 16:45:44 DEBUG (MainThread) [pymyq.request] Sending myq api request https://devices.myq-cloud.com/api/v5.2/Accounts/9ae0865e-c3a8-49ce-ad2c-1d8721850987/Devices and headers {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjBDQzRGRENBNEY0MUZBNkMwOUVCN0U3REQ1RTFBODU2QzBERUU0RjMiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJETVQ5eWs5Qi1td0o2MzU5MWVHb1ZzRGU1UE0ifQ.eyJuYmYiOjE2MTMwODcxMzIsImV4cCI6MTYxMzA5MDczMiwiaXNzIjoiaHR0cHM6Ly9wYXJ0bmVyLWlkZW50aXR5Lm15cS1jbG91ZC5jb20iLCJhdWQiOlsiaHR0cHM6Ly9wYXJ0bmVyLWlkZW50aXR5Lm15cS1jbG91ZC5jb20vcmVzb3VyY2VzIiwiTXlRX1Jlc2lkZW50aWFsIl0sImNsaWVudF9pZCI6IklPU19DR0lfTVlRIiwiY2xpZW50X0FwcGxpY2F0aW9uSWQiOiJjNGJlMGQ0OS1hNzEwLTQ0OTAtYTZkYy03ZTkwM2M1YzNiNTgiLCJzdWIiOiI5YWUwODY1ZS1jM2E4LTQ5Y2UtYWQyYy0xZDg3MjE4NTA5ODciLCJhdXRoX3RpbWUiOjE2MTMwODcxMzEsImlkcCI6ImxvY2FsIiwiRW1haWwiOiJnYXJ5a0B3aWxkcmlkZXJzLm9yZyIsIkFwcElkIjoiYzRiZTBkNDktYTcxMC00NDkwLWE2ZGMtN2U5MDNjNWMzYjU4IiwianRpIjoiMjljYmU4ZjNiMDk1ZDJmMDRkMDA4NGMzMWYwMDAyY2MiLCJzY29wZSI6WyJNeVFfUmVzaWRlbnRpYWwiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIl19.tYKWwJFhVaLtgQM2KQkdOI5ZaK7qQncA6kAFT_elrtHkGMk7a_mJn0k9tURn_g_95uXiXWJ-zXmzQhZuNC3Yvnqe9B00ALKHTDzI6BejRcSpkp9cy_M_M8NpDMf5LFbAoDAnWfkSpKbBrReHgFBQ5DkkDrsZESO8DSjEmMKoEv-1IDdLZNv6TbWfLI2IsnLi-wBwQnr1uCnuAzRnqC584AZQktI0BFjmL6fYiIJOInfcFzK8_eStjQoW2juUKJV89jWBUqAOYLXiD1BGZ_R6fU6bDAc2ZFIelti2qCnVPrJExiz63udNcjZA77c75yd4z6s-grZeOSBVGmkyuc6nMg'} with connection pooling
2021-02-11 16:45:44 DEBUG (MainThread) [pymyq.request] Response:
2021-02-11 16:45:44 DEBUG (MainThread) [pymyq.request]     Response Code: 200
2021-02-11 16:45:44 DEBUG (MainThread) [pymyq.request]     Headers: ((b'Content-Type', b'application/json; charset=utf-8'), (b'MyQ-CorrelationId', b'90d0ab81-8ff9-4a6a-93a7-961f3ddb2c31'), (b'Request-Context', b'appId=cid-v1:bc101484-b436-4560-8ec1-bc87b4b0d982'), (b'Access-Control-Expose-Headers', b'Request-Context'), (b'Date', b'Thu, 11 Feb 2021 23:45:43 GMT'), (b'Content-Length', b'2040'))
2021-02-11 16:45:44 DEBUG (MainThread) [pymyq.request]     Body: {"count":3,"items":[{"href":"/accounts/9ae0865e-c3a8-49ce-ad2c-1d8721850987/devices/garagedoor/CG083A1A1B7B","serial_number":"CG083A1A1B7B","device_family":"garagedoor","device_platform":"myq","device_type":"garagedooropener","device_model":"garagedooropener","name":"Big Door","parent_device_id":"GW21000029C5","created_date":"0001-01-01T00:00:00","account_id":"9ae0865e-c3a8-49ce-ad2c-1d8721850987","state":{"gdo_lock_connected":false,"attached_work_light_error_present":false,"attached_camera_serial_number":"","door_state":"closed","last_update":"2021-02-11T16:08:27.1563095Z","is_unattended_open_allowed":true,"is_unattended_close_allowed":true,"online":true,"last_status":"2021-02-11T23:41:34.078615Z"}},{"href":"/accounts/9ae0865e-c3a8-49ce-ad2c-1d8721850987/devices/gateway/GW21000029C5","serial_number":"GW21000029C5","device_family":"gateway","device_platform":"myq","device_type":"ethernetgateway","device_model":"ethernetgateway","name":"Garage Doors","created_date":"0001-01-01T00:00:00","account_id":"9ae0865e-c3a8-49ce-ad2c-1d8721850987","state":{"allow_bluetooth_lock":false,"firmware_version":"1.6","homekit_capable":false,"homekit_enabled":false,"learn_mode":false,"updated_date":"2021-02-11T08:57:10.7060758Z","physical_devices":[],"pending_bootload_abandoned":false,"online":true,"last_status":"2021-02-11T08:57:07.6937494Z"}},{"href":"/accounts/9ae0865e-c3a8-49ce-ad2c-1d8721850987/devices/garagedoor/CG083A1A1ABB","serial_number":"CG083A1A1ABB","device_family":"garagedoor","device_platform":"myq","device_type":"garagedooropener","device_model":"garagedooropener","name":"Small Door","parent_device_id":"GW21000029C5","created_date":"0001-01-01T00:00:00","account_id":"9ae0865e-c3a8-49ce-ad2c-1d8721850987","state":{"gdo_lock_connected":false,"attached_work_light_error_present":false,"attached_camera_serial_number":"","door_state":"closed","last_update":"2021-02-11T03:52:37.972167Z","is_unattended_open_allowed":true,"is_unattended_close_allowed":true,"online":true,"last_status":"2021-02-11T23:42:41.7446825Z"}}]}
SConaway commented 3 years ago

I can send you mine. Feel free to shoot me an email at steven.conaway@icloud.com if you want my data. I have two lights and a door. Just don't want to post all that possibly-personal info here.

Also, toggling lamps isn't working, FYI.

ehendrix23 commented 3 years ago

Thank you! Got what lamps returns which is helpful.

There was an issue in pymyq v3.1.0b1 causing error when trying to open/close covers and turning on/off lamps. This should now be fixed. pymyq 3.1.0b2 has been pre-released with the fix.

MyQ in HACS has been updated to v1.0.0b2 to include this fix. So for those that have installed this, please update to v1.0.0b2 now available.

Thx.

ds7771 commented 3 years ago

Uh Oh, did MyQ change their API again? I am disconnected and unable to authenticate through HA plugin as of 4:30 PM Eastern.

But MyQ app authenticates just fine.

dseven commented 3 years ago

I'm getting HTTP 400 since 21:20 UTC. There was an outage last week and it got resolved. Maybe this is another. Let's watch it for a bit.

ds7771 commented 3 years ago

Yep, just now bothered to read the HB Discord channel, and I see they are in the same boat.

SConaway commented 3 years ago

Error fetching myq devices data: Error trying to re-authenticate to myQ service: Error requesting data from https://partner-identity.myq-cloud.com/connect/token: 400 - Bad Request is the log from HASS. Since it's a 4xx error I'm wondering if it's a change not an outage (wouldn't that be a 5xx error)?

dseven commented 3 years ago

Looks like our old friend, user-agent. I tried setting it to something bogus (other than "null") and things started working again. Yay!

broyuken commented 3 years ago

Does this component by any chance control the lamps built into the door openers? I don’t believe the app does so probably not but worth an ask.

ehendrix23 commented 3 years ago

Does this component by any chance control the lamps built into the door openers? I don’t believe the app does so probably not but worth an ask.

It they do not show up in the app then very doubtful they will show up here. :-)

ehendrix23 commented 3 years ago

Beta HACS component for myq now has been updated as well to v1.0.0b5 to include the fix for authentication issue.

SConaway commented 3 years ago

Does this component by any chance control the lamps built into the door openers? I don’t believe the app does so probably not but worth an ask.

It they do not show up in the app then very doubtful they will show up here. :-)

AFAIK, the lights are only controllable on the unit/button thing and aren't remotely accessible.

The beta component is working for me!

broyuken commented 3 years ago

Does this component by any chance control the lamps built into the door openers? I don’t believe the app does so probably not but worth an ask.

It they do not show up in the app then very doubtful they will show up here. :-)

I know, but there’s always some chance somebody found some hidden api call that myq isn’t using yet. It would be nice if myq added that functionality or the ability to see the status of the sensors in the app. Motion, temperature, etc. Just wishful thinking.

ehendrix23 commented 3 years ago

Closing, lamps have been integrated.