It's very useful if your Raspberry can trigger events based on time and sunset and sunrise. That's why I did some investigations on this and finaly found two APIs in the internet which allowed me to write a Python script to calculate these values very fast. gneadr found another interesting variant which I modified a bit.

The location calculated is the place where the internetprovider offers the IP address to the client and which can be far away from the actual client location. In my case it's approx 30 km.

Add comment

Note

eMail is not visible to the public and used to subscribe you to comment updates. You can unsubscribe at any time because any notification eMail has an unsubscribe link.

Spam comments are purged and not published to protect subscribers from spam eMails. Review is done manually and therefore your comment will not be published immediately.