Sunrise and Sunset times are way off for my location

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 :slight_smile:

1 Like

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:

  1. That redirects to https:// (super minor caveat) but once you use that, it works.
  2. 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 including Authorization: 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 :sweat_smile: 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).