I created a Sunrise/Sunset Tile!

Kris L 5 years ago in Media Tiles / Weather & Traffic updated 2 years ago 11

I'm sharing this for others to use!

Use this Media Still Image URL:


Use the base URL https://sunsettile.app/sunset for sunset and https://sunsettile.app/sunrise for sunrise

Required parameters: 

lat (latitude)

long (longitude)

bgcolor (background color  - hex color without #)

fgcolor (foreground color - hex color without #)

Optional parameters:

timeformat=24 (For 24 hour time)

offset= (number of minutes, positive or negative)

Please set the refresh time to at least every 12 hours (43200 seconds) to be nice to my server.


Great work, Kris: Thanks for sharing!

The SmartThings Weather Tile "Device" supplies Sunrise and Sunset as Custom Attributes; but we only display them on the full Weather Tile itself.

We recognize the value of providing Tiles that can display arbitrary Attributes (or execute arbitrary Commands) and this will likely be a Feature someday.

This is a great interim workaround - and a great proof-of-concept.


If anyone would like other features... they can make a pull request :)


Thank you for sharing.

Thanks for creating this. Are there plans to add a parameter to adjust the font to match AT themes?  

Not something I plan on implementing.  

I've noticed that this is showing sunrise/sunset times 1 hour later than they should be.  I think it's related to DST.  Is there a querystring parameter to adjust it?  My example is here:


Interesting!  It is showing the right time for me.   Let me see what it would take to add an offset.

Your feature request has been implemented :)

new query param &offset= (number of minutes, positive or negative)

You're awesome!  And I'm very sorry to say that it turns out i didn't need it, it was simply user error.  The problem was that my longitude was backwards (it was probably perfect for Kyrgyzstan), so instead of 73 it should have been -73.  

Successfully migrated this to a Lambda with AWS API Gateway in front.. so I no longer have to worry about an EC2 instance or remembering to renew the SSL cert :)

This is awesome! Question though, is there a way of setting background transparency?