Rule with Astro-binding does not trigger correctly

openHAB is event driven. There are different event types (see

for a complete list.
The point is: for Items there are three events:

  • Item received a command
  • Item status received an update
  • Item status has changed

The first will only trigger when a command is received, i.g. click in the UI or do a .sendCommand() in a rule
This is NOT about a status at all! It’s only a command!
The second trigger is, when the item received an update. It may differ from the previous status or not, the trigger will take place.
The third is triggered, if the update resulted in a change of the status. So, it’s on a specific part of the second trigger. Every changed event succeeds an update event.

On the other hand, there is only one option for an event channel, the event does occur. There is no command, there is no change (as the channels are stateless).

But there may be different events on one event channel, e.g. in astro you will get a START event and an END event for most if not all of the event channels. That is because of the definition of the events, e.g. sunrise is the moment, the sun goes up from negative elevation to positive elevation, so there is a imaginary line at the horizon (ignoring mountains, of course) and the sun passes this line, BUT: the sun isn’t a single dot but a circle, so there is a START (sun touches the line) and an END (sun leaves the line). Depending on Season and position the transition may take two to eight minutes (but I’m no expert to astronomy, so there may be even larger transition times).

If you want to use many different astro events, there is a Time of day rule for that purpose, see

AFAIR rlkoshak built the rule also in DSL and there may be a rule template already. The idea is, to build one String Item which then will be set to different Strings, maybe NIGHT, MORNING, NOON, AFTERNOON, EVENING, but you’re free to define it at your will. Then you can check whether the Item has one of a bunch of “allowed” statusses. It may be an option to use a Number Item instead so it would be possible to check ranges as well.