NCO
(E. Gerland)
1
All,
I used this script to activate the connection to myopenhab.org:
#!/bin/bash
curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" -d "{
\"mode\": \"remote\",
\"baseURL\": \"https://myopenhab.org/\"
}" http://localhost:8080/rest/services/org.openhab.openhabcloud/config
(and deactivate using notification instead of remote to block alexa from access)
since OH3 I get:
{"error":{"message":"Authentication required","http-code":401}}openhabian@homer:/etc/openhab/scripts
Anyone, who can help modifying the above script to succeed?
(@jeshab ): This is originally from you (thread below) - maybe you know how to do it ?
jeshab
(Jeremy)
2
You need to setup and use an API token in OH3 to update a service config
NCO
(E. Gerland)
3
Thank you!
I will give it a try and post the results.
NCO
(E. Gerland)
4
I have a token now, but how to hand this over to the curl expression in the script?
jeshab
(Jeremy)
5
#!/bin/bash
curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" -d "{
\"mode\": \"remote\",
\"baseURL\": \"https://myopenhab.org/\"
}" http://<api_token>@localhost:8080/rest/services/org.openhab.openhabcloud/config
1 Like
NCO
(E. Gerland)
6
Awesome. That’s it.
Thank you very much!