Homey Community Forum

[Tutorial] Reboot Philips Hue Sync Box

Introduction
My personal expirience with the Hue Sync Box is pretty cool but it seems it is still not as stabile as it should be. For example if you’re switching between HDR and non HDR content it will become unstable after a while. You can see that because the video signal gets interrupted from time to time which is pretty anoying. The good news is that this can easily be resolved with a reboot but the bad news is that this isn’t supported by the official Hue app by Athom. But as the api of the box supports it, there are ways to still get the job done.

Requirements

Step 1 - Obtain the ip address of the Hue Sync Box
The easiest way is to go into the official Hue Sync app -> settings -> devices -> select your Sync Box and check for the IP-Address. Note: depending on your router settings this address might be dynamic. In that case you’ll need to adapt your flows when this happens or you need to auto-discover your box (out of scope for this tutorial).

Step 2 - Access token
To perform requests to the Sync Box we need to authorize the request which is done by providing an access token. To obtain this we of course using Homey!

  1. Create a new flow called ‘register on Hue Sync Box’ with any trigger you like.

  2. As action choose “Advanced Rest Client (ARC)” -> “Perform a Request” and use the following options:

  3. Create another flow card called ‘request performed’ and choose “Advanced Rest Client (ARC)” -> “Request completed” as trigger. As action choose “Simple Log” -> “Add something to the log” and set the “Response Body” token as text.

  4. Now you’re ready to perform the actual registration!

    • Trigger the first flow card and go the the app “Simple Log” configuration. You now should see something like {“code”:16,“message”:“Invalid State”}
    • Now it gets tricky: trigger the flow and within 5 seconds, press the button on the Hue Sync Box until it flashes green. And withing 5 seconds, trigger the flow again.
    • Back in the simple log you now should see something like {“registrationId”:"[some number]",“accessToken”:"[some cryptic text]"}

Step 3 - Create custom header collection
Go to the configuration of the “Advanced Rest Client” app -> headers and click “Add Collection”. Give it a name and description. In “New Header Name” put “Authorization” and in “New Header Value” put “Bearer [the cryptic token from above]”. Click “Add Header to Collection” and then “Save” to complete.


Step 4 - Create Reboot flow card
Create a new flow card with any trigger you wish and set “Advanced Rest Client (ARC)” -> “Perform a Request” as action card with the following options:

Congratulations - you now should be able to reboot your Hue Sync Box!

2 Likes

Thanks for sharing this. I tried to install the app several times but nothing happend.

There was a bug that affected Homey v4.x (see [Store][Bug] Users cannot download app from the store · Issue #162 · athombv/homey-apps-sdk-issues · GitHub) but that should now be fixed. Can you please try again?

Hi and thank you. I have just installed it. :+1:t3:

Now I’m struggling with
2021-01-04 21:31:45 {“code”:12,“message”:“Invalid JSON”}

I have double checked everything but still
(“code”:12,“message”:“Invalid JSON”})

Seems to be an autoformatting issue of this forum:/ You need to replace the doubble quotes to propper ones ( and also everywhere else where it applies). Any idea how to post things here s.t this does not happen?

Yep, the most obvious thing, using the code button, as it truly is code ( </> )

1 Like

I’ve adapted it, please copy & paste it again!

1 Like

Thank you! :+1:t3::+1:t3::+1:t3: Now it works for me.

1 Like

Thnx, great job!!

1 issue… i keep getting the error: Invalid Token
this while i think i did everything right. I did got a very long base64 and then i decoded it and then i got a readable json output but after the regular, was followed by jibberjabber to me. So i thought i needed to leave out everything after the double ==
i decoded the base64 again en now i get only normal readable json output. But still; invalid token.

Any idea?

What did you decode? There should be no need to do so…

i know. but i wanted to know if the data in the base64 code is right. so i decoded it to see.