hufftheweevil / node-red-contrib-august

1 stars 1 forks source link

No longer working after forced migration for users outside of US #3

Closed foil81 closed 1 year ago

foil81 commented 1 year ago

This has been working flawlessly for years until just recently Yale lock users outside of the US were forced to migrate to the new Yale Home app.

This was fixed in the Home Assistant integration here: https://github.com/home-assistant/core/issues/93195

Just wondering if there is any chance it can be update to work here? As this is really useful in nodered, it would be great if it was possible?

foil81 commented 1 year ago

Looks like while the APIs havenโ€™t changed, yet the urls for each (depending on the lock and users location) are either one of the three:

Brand.AUGUST: "https://api-production.august.com"
Brand.YALE_ACCESS: "https://api-production.august.com"
Brand.YALE_HOME: "https://api.aaecosystem.com"

although I donโ€™t really understand how it all works to be honest!

foil81 commented 1 year ago

I ended up modifying a few lines then re-started node red and works fine now. I think I can close off this issue as it relates to the august-api. If anyone who is outside of North America with a Yale/august lock reading this (and will have issues now) and have migrated to the new app, can make a manual change.

Basically I changed the following:

.\august-api\src\util\setup.js const DEFAULT_PN_SUB_KEY = 'sub-c-c9c38d4d-5796-46c9-9262-af20cf6a1d42'

and

.\august-api\src\index.js const API_URL = 'https://api.aaecosystem.com/'

so far everything works perfectly.

I noticed that the home assistant august integration now allows you to select the API depending on your location. Might be nice as a feature request in the future, when you can, to add to this? Thanks!

Andoramb commented 1 year ago

@foil81 I've followed your steps, it works for me as well :) Thanks!

foil81 commented 1 year ago

Hey @Andoramb - did it just stop working for you tonight? Node red wouldn't start and I had to start in safe mode and disable the august api node. ill look into it further why its no longer working, I know this is all voluntary, I just one day hope Americans know they are 2% of the world's population, and there is 98% of the world out there ๐Ÿ˜จ message me if you need any help.

Andoramb commented 1 year ago

@foil81 Haha, you're right! Suddenly my node-red started rebooting, nothing worked around the house ๐Ÿ˜„ It's a bummer, since it managed to connect, sync and worked alright, so it is definitely possible to patch it somehow. I also had to manually remove everything from my flows, then it was back to normal. I'll be following this, if anything comes up. ๐Ÿ˜„ It's nice to have my lights turned off, when I close the door and leave ๐Ÿ˜† Thanks!

foil81 commented 1 year ago

@Andoramb I got it working again.

Change the following:

.\august-api\src\util\setup.js const DEFAULT_API_KEY = 'd9984f29-07a6-816e-e1c9-44ec9d1be431'

Then restart node red, try adding again

Let me know how it goes!

Andoramb commented 1 year ago

hey @foil81 I've watched this for some time, currently I cannot allow myself to experiment with this as my node-red config is quite important to be messed up.

But how does it behave?

But I will try it out asap. Thanks

anagram-NOj commented 1 year ago

@foil81 and @Andoramb, The steps appear simple enough but I'm already way outside my comfort zone. Unfortunately I've not followed the best practise when I initially set up this with Container station on QNAP - it appears it's not as trivial as changing out a few lines of code.

hufftheweevil commented 1 year ago

Fixed with v1.2.0

anagram-NOj commented 1 year ago

Based on some simple testing, it appears to be working for Yale Doorman L3 and Yale Linus, with Yale Home app in Norway. Thankyou so much!!

Andoramb commented 12 months ago

OK, now I don't get any locks discovered ๐Ÿ˜€ I've managed to validate my email, but the profile configuration always stays on August. And I get FetchError: Status 401 (undefined): undefined.

Additionally, this pops up in my NR log:

15 Nov 09:49:43 - [info] Starting modified flows
TypeError: Cannot read properties of undefined (reading 'padEnd')
    at Flow.start (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:308:62)
    at async start (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/index.js:398:17)
15 Nov 09:49:43 - [info] Started modified flows
FetchError: Status 401 (undefined): undefined
15 Nov 09:49:48 - [info] Stopping modified flows
15 Nov 09:49:48 - [error] 
********************************************************************
Unexpected Node Error
********************************************************************
Info:
 Node object is not a node-red Node
Stack:
 TypeError: Cannot read properties of undefined (reading 'length')
    at August.Node.close (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:314:41)
    at stopNode (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:745:31)
    at Flow.stop (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:387:35)
    at /usr/src/node-red/node_modules/@node-red/runtime/lib/flows/index.js:477:43
    at Array.forEach (<anonymous>)
    at stop (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/index.js:473:19)
    at /usr/src/node-red/node_modules/@node-red/runtime/lib/flows/index.js:220:20
Please report this issue, including the information logged above:
https://github.com/node-red/node-red/issues/
********************************************************************
15 Nov 09:49:48 - [info] Stopped modified flows