I was asked to create a HomeKit automation that turns on a certain light at 4:30AM if the sun has not already risen. This is a good exercise to play with Weather and the wealth of useful information therein.
We’ll start by opening either the Home or Shortcuts app. We then choose Automation (at the bottom) and press the plus sign (+) in the top right corner to add a new automation. Select Create Home Automation. Then select A Time of Day Occurs and set the Time of Day to 04:30. Instead of choosing a certain light or device, we scroll all the way down to Advanced and press Convert To Shortcut.
We’ll start the shortcut with Get current weather at Current Location. (You can put your address in the Current Location if you want to.) We put Get Details of Weather Conditions after that, and choose Sunrise Time as the detail we want.
Now we need to add an If statement. As Input we choose Current Date and as Condition we set is before, and for the last Date we choose Sunrise Time. We’ll add a Control Home action within the If statement where we choose the lamp or lamps we want to turn on, and set them to the brightness we wish. Finally we can remove Otherwise.
And that’s how simple it is. The current weather action has a lot of different data points that can be useful in many shortcuts. Your imagination is the limit.