Ah, good point. You have to use the -j option with the devices command to get the detail of your hub. I was just thinking in that same line of thought and didnβt try it without the -j
Nice! Thanks. This also works well. I didnβt actually read any documentation at all, but this was straight to the point so it βjust workedβ for me. Just documenting my journeyβ¦ just a few minor notes to get it to work:
- That redirects to
https://
(super minor caveat) but once you use that, it works. - After installing the CLI, I easily found a token I could use under
~/.config/@smartthings/cli/credentials.json
, so at that point it was a simple matter of includingAuthorization: Bearear {{TOKEN}}
HTTP header (I assumed they used this scheme, typical REST)
The final/full curl
request is essentially:
export ST_TOKEN="YOUR-TOKEN-UUID"
export ST_LOCATION="YOUR-LOCATION-UUID"
curl -v -H "Authorization: Bearer $ST_TOKEN" "https://api.smartthings.com/services/coordinate/locations/$ST_LOCATION/capabilities?name=weather"
Which emits sunsetTimeLocal
which is the local time of sunset (naturally in Zulu, lol, no TZ offsetβ¦ so itβs local, but itβs not) but it resolves to 8:40pm for me which is exactly right for today for Portland. Great success.
you may want to reconsider posting your Latitude and Longitude info online. just a thought if you are concerned about privacy.
It was very intentional I was very deliberate on the specific coordinates I swapped in, hoping someone would catch on and comment on it, lol. My computer isnβt named compy386
either (that was just a reference).