Tip for setting ‘non-standard’ times as conditional
I needed to add a time conditional to a light sensor trigger automation for 1 hour before sunset to 15 minutes after sunset. This can’t be done in the Apple Home app AFAIK.
I fired up one of my third party HomeKit apps and added the conditional of ‘between 1 hour before sunset and 15 minutes after sunset’. Looked fine, went back to Apple Home and saw that it was shown as a “custom condition”. And critically, it didn’t work. The automation was firing outside those times.
After much trial and error, I discovered the trick: first add just ‘1 hour before sunset’. Save automation. Then add as a separate condition ‘15 minutes after sunset’. Save the automation. Now go check Apple Home and it should show the time conditional correctly.
Important note: if you make any changes to the automation it will ‘break’ again, and you’ll need to remove the time conditional and go through the steps above again.