bdraco / yalexs

Python API for Yale Access (formerly August) Smart Lock and Doorbell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

august activities api change - log collection

fishy242 opened this issue · comments

I have an Yale Assure Lock (with Wi-Fi bridge) and connect to my Home Assistant via August integration. I have an automation in Home Assistant which rely on the state change in Lock Operator. Recently the automation fail and I found that its state is keep staying as "Master PIN". Before if I unlock the door manual, the state is changed to "manualunlock" (something like this, I can't remember exactly)

I capture few lines in debug log to see if you have some clue?

`2022-10-07 20:44:35.716 DEBUG (MainThread) [pubnub] {'t': {'t': '16651286754054318', 'r': 34}, 'm': [{'a': '5', 'f': 0, 'i': 'xxxxxxxx', 'p': {'t': '16651286754054318', 'r': 43}, 'k': 'xxxxxxxx, 'c': 'xxxxxxxx', 'd': {'status': 'unlocked', 'callingUserID': 'manualunlock', 'doorState': 'closed'}}]}

2022-10-07 20:44:35.720 DEBUG (MainThread) [yalexs.pubnub_async] Recieved new messages on channel xxxxxxxx for device_id: xxxxxxxx with timetoken: 16651286754054318: {'status': 'unlocked', 'callingUserID': 'manualunlock', 'doorState': 'closed'}

2022-10-07 20:44:35.720 DEBUG (MainThread) [yalexs.api_common] Processing activity: {'deviceID': 'xxxxxxxx', 'house': 'xxxxxxxx', 'dateTime': 1665128675405.432, 'deviceName': 'Front Door', 'deviceType': 'lock', 'info': {}, 'action': 'unlock'}

2022-10-07 20:44:35.721 DEBUG (MainThread) [yalexs.api_common] Processing activity: {'deviceID': 'xxxxxxxx', 'house': 'xxxxxxxx', 'dateTime': 1665128675405.432, 'deviceName': 'Front Door', 'deviceType': 'lock', 'info': {}, 'action': 'doorclosed'}

2022-10-07 20:44:35.734 DEBUG (MainThread) [pubnub] GET https://ps.pndsn.com/v2/subscribe/sub-c-xxxxxxxx?tt=16651286754054318&tr=34&pnsdk=PubNub-Python-Asyncio%2F7.0.1&uuid=pn-xxxxxxxx None

2022-10-07 20:44:37.634 DEBUG (MainThread) [pubnub] {'t': {'t': '16651286773667966', 'r': 34}, 'm': [{'a': '5', 'f': 0, 'i': 'pn-xxxxxxxx', 'p': {'t': '16651286773667966', 'r': 42}, 'k': 'sub-c-xxxxxxxx', 'c': 'xxxxxxxx', 'd': {'status': 'unlocked', 'callingUserID': 'masterpin'}}]}

2022-10-07 20:44:37.635 DEBUG (MainThread) [yalexs.pubnub_async] Recieved new messages on channel xxxxxxxx for device_id: xxxxxxxx with timetoken: 16651286773667966: {'status': 'unlocked', 'callingUserID': 'masterpin'}

2022-10-07 20:44:37.635 DEBUG (MainThread) [yalexs.api_common] Processing activity: {'deviceID': 'xxxxxxxx', 'house': 'xxxxxxxx', 'dateTime': 1665128677366.796, 'deviceName': 'Front Door', 'deviceType': 'lock', 'info': {}, 'action': 'unlock'}

2022-10-07 20:44:37.638 DEBUG (MainThread) [pubnub] GET https://ps.pndsn.com/v2/subscribe/sub-c-xxxxxxxx?tt=16651286773667966&tr=34&pnsdk=PubNub-Python-Asyncio%2F7.0.1&uuid=pn-xxxxxxxx None`

August discontinued updating the old api endpoints we were using so we had to switch to the new one.

There have been a few updates to add support for the new format but there is still more work to do.

#37
#38

If you want to help out, you could open a PR to map anything you see on your device that wasn't added by the above

Also the data format

user_id = calling_user.get("UserID")
has changed so it needs to be updated to handle the new format

Even just the Processing activity log lines when turning on debug logging would help

2022-10-07 08:51:48.670 DEBUG (MainThread) [yalexs.api_common] Processing activity: {'id': '607f758a-7215-4ce5-b5d2-1107f7b47fbf', 'timestamp': 1665004661000, 'icon': 'https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/door_close@3x.png', 'action': 'door_close', 'deviceID': 'EC248829055E4F11AEDB7DE474B92D69', 'deviceType': 'lock', 'title': 'Door with <b>Garage Exit Door</b> closed'}

as a very beginner on home assistant development, I want to ask a very basic question. Where does this package located with HA? How can I start debugging it? Is there any doc I can refer to?

Insert this into your configuration.yaml file:

logger:
  default: critical
  logs:
    homeassistant.components.august: debug
    yalexs: debug

I see this had been updated and working now, thanks a lot!