As you noted, the device event would be the trigger and you could use an IF Condition within the rule to restrict the execution.
You can edit the condition to use OR for before sunrise or after sunset. This post with the visualization might be helpful to you.
The logs should have the Runtime Data showing the various states that were used up to the comparison failure, but yes, you will have to compare those manually to your rule conditions.