Update March 4
Homey v2.0.5-rc.2 has been release to the experimental channel, amongst other improvements it adds a new experimental functionality: Power user.
This new function enables advanced Flow cards & system profiling in Insights.
These are the Flow cards (in the System category) that become available when you enable the Power users Experiment:
The Restart Homey card makes the instruction below superfluous but I will leave it here for informational purposes.
This flow will let you reboot Homey
Sometimes you just want your Homey to reboot, with this flow you can for example schedule a reboot or reboot when a certain condition is met.
- Disclamer: This is an advanced flow, use this information at your own risk.
Make sure you use it wisely and understand what your flow will do. You donât want to get your Homey into a boot loop from which you can not recover it!
What is needed to create this flow?
For this flow the HTTP request flow cards app needs to be installed. You also need your Bearer Token. How to obtain this will be explained below.
Open your favorite text editor, for example Notepad, and copy paste the found information from the next steps into it.
Find your Bearer Token
Open Chrome and open the developer tools ( ctrl-shift-j on Windows, cmd-option-j on Mac)
Select the Network tab, enable Hide data URLs and click All
next navigate to https://developer.athom.com , make sure youâre logged on, and see the info appear. Now search for a line that shows me and click on it.
Check if the end of the Request URL in the right pane shows sessions/session/me and has a Status Code 200 OK
Now scroll down in the right pane and search for the authorization variable. Copy that code to your text editor.
So now you should have something like this in your text editor
Bearer 52c--------------------------------:------------------------------------------:-------------------------------------54a
The dashes would be numbers or letters
Now you need to prepare the actual information to send to Homey with a HTTP card. Copy the text below to your text editor
{
"method":"POST",
"protocol":"http:",
"hostname":"127.0.0.1",
"path":"/api/manager/system/reboot",
"headers":
{
"Authorization":"authorization"
}
}
and replace authorization with the information collected earlier, the result should look like this
{
"method":"POST",
"protocol":"http:",
"hostname":"127.0.0.1",
"path":"/api/manager/system/reboot",
"headers":
{
"Authorization":"Bearer 52c--------------------------------:------------------------------------------:-------------------------------------54a"
}
}
again, the dashes would be numbers or letters
Next step will be to transform the text to one line, it should look like this:
{"method":"POST","protocol":"http:","hostname":"127.0.0.1","path":"/api/manager/system/reboot","headers":{"Authorization":"Bearer 52c--------------------------------:------------------------------------------:-------------------------------------54a"}}
By now you know about the dashes, right?
Now open the webversion of the flow editor at flow.homey.app and click the + Create a Flow button.
Enter a name for the flow, Reboot Homey for example.
Next click on the Add card button in the When⌠âcolumnâ
and select the card you want to use as a trigger, for this example we will use the This Flow is started card so it will look like this:
Next will be the action card, the one where the magic happens. Click on the Add card button in the Then⌠column and select the POST form card from the HTTP request flow cards app.
This card will need the information youâve collected so select the whole line you have prepared earlier and copy paste it into the top text box of the action card. Next put a space in the second text box and remove that again.
The flow should now look like this
Save the flow. If you now click the Test button your Homey will be rebooted.
If it doesnât work for you, please double check the steps above. If that doesnât fix it, please post the error you get in this topic, make sure when posting screenshots you make your Bearer token unreadable!
- Your Bearer Token is information you need to keep secret
- Remember that your Bearer Token can change over time! Itâs basically a code with a limited lifetime thatâs handed out when you successfully log on. So at some point your flow could stop working and youâll have to replace the Bearer Token.
- When I open flow.homey.app the cards are in one column, how do you get them in a row? Please see Homey Flow for Web - three Column view [CSS customization]
- Can I do more with this? Yes, there are more API endpoints you can call using this flow. If you know an endpoint you will have to replace the content of the
path
variable in the JSON formatted command.
@johan_bendz started a list on github GitHub - JohanBendz/Homey-Endpoints and some can be found in the sourcecode of the Candy app
- Ultimately there should now be no reason to reboot your Homey an a regular basis. If you see the need for it please try to find out why itâs needed and report that to Athom so a sustainable fix can be made for the benefit of all Homey users.