lukasroegner / homebridge-philips-hue-sync-box

Homebridge plugin for the Philips Hue Sync Box.
MIT License
55 stars 12 forks source link

Token issue #37

Closed st3vk closed 3 years ago

st3vk commented 3 years ago

Hello,

I'm having an issue with the homebridge-philips-hue-sync-box I'm trying to do the https://<SYNC-BOX-IP>/api/v1/registrations but I don't get the token

Capture d’écran 2021-01-09 à 21 51 35

I'm maybe missing something on the steps but I can't not use the plug-in.

Thanks,

Steven

st3vk commented 3 years ago

I did it using python

import requests
import json
from time import sleep

url = "https://<INSERT IP OF SYNCBOX HERE>/api/v1/registrations"
data = {'appName': 'hass', 'appSecret': 'MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=', 'instanceName': 'hass' }
headers = {'Content-type': 'application/json'}
while True:
    sleep(1)
    r = requests.post(url, data=json.dumps(data), headers=headers, verify=False)
    if r.json().get('accessToken') != None:
        print("Your accessToken is " + r.json().get('accessToken'))
        break

Then I pressed the button on the Sync Box and I gave me the Token