+7

I created a Sunrise/Sunset Tile!

Kris L 6 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:

https://sunsettile.app/sunset?lat=38.7535121&long=-120.5807933&bgcolor=3b3749&fgcolor=ffffff&size=3x2

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.

Discuss

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.

+1

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

https://github.com/klinquist/SunsetActionTile

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:

https://sunsettile.app/sunset?lat=42.0000&long=73.0000&bgcolor=555555&fgcolor=ffffff&size=2x1

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?