In this tutorial I will guide you how to show the sunrise time in FHEM
Prerequesites: – a working FHEM version
- Open the FHEM configuration file (fhem.cfg) under Edit files.
- Add the following global attributes to set your location.
Replace the latitude and longitude values with your desired location. The decimal values of your location can be determined here.
- To save the values for sunrise and sunset we are going to create two dummies
- As the values need to be generated every day after 12 pm we define the following function
This way, the next time of sunrise and sunsets will be set every day at 0.05 am to the dummies.
- Now we need to assign the room “Weather” to the dummies
Finally, your code should look like this:
You can use the following commands if you want to know the brightness of the sunrise or sundown
More information to sunrise() can be found on the Commandref page.
Please leave a comment if you have questions or ideas.