I was reading that the timing of when you send the POST request is important, so I wrote a quick Python script that loops the request until it gets back a 200 status code. It made it super easy to get the auth code.
import logging
import requests
import time
while True:
r = requests.post('https://YOUR.IP.ADDRESS.HERE/api/v1/registrations',
json={
"appName": "homebridge",
"appSecret": "MDAwMTExMDAwMTExMDAwMTExMDAwMTExMDAwMTExMDA=",
"instanceName": "homebridge"
}, verify=False)
print(r.status_code, r.json())
if r.status_code == 200:
break
time.sleep(0.1)
print("Done")
I was reading that the timing of when you send the POST request is important, so I wrote a quick Python script that loops the request until it gets back a 200 status code. It made it super easy to get the auth code.