OH3 Rule sun:event

I have created a Rule for the channel Astro Sun and want to have it triggered when sunset.

My rule:

And I see in the logs that at 19:53 it has triggered, but it seems the rule was not fired.
Did I forget something to set or add?

2021-08-31 19:53:00.010 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:d6e9896662:set#event triggered START

Where possible, please don’t post screen shots. They cannot be searched, copy and paste doesn’t work, and they are never complete. Click on the code tab and past the full code for the rule.

Here is an example of sunset with an offset.
It will give you the idea of how to do the sunset rules.

Sorry will do:

  - id: "1"
      thingUID: astro:sun:d6e9896662
      event: start
      channelUID: astro:sun:d6e9896662:set#event
    type: core.ChannelEventTrigger
conditions: []
  - inputs: {}
    id: "2"
      itemName: Group_RollerShutter
      command: "50"
    type: core.ItemCommandAction

Thanks I have exactly set it like in your screenshots (except the offset).

OK, so I assume that you surmise the that the rule didn’t trigger because the rollershutters didn’t go to 50%.

What is the type of Group_RollerShutter. It’s clearly a Group based on the name but what’s the secondary type? Does it have one? Does it have an aggregation function? Does it have any members?

One thing you can do since sitting there at MainUI during the event is likely not a great option is to modify $OH_USERDATA/log4j2.xml. Go down to the line that reads:

                <Logger level="ERROR" name="openhab.event.RuleStatusInfoEvent"/>

and change "ERROR" to "INFO". That will cause the a log entry to be printed to events.log when your rules run. You can use that to prove that the rule is in fact running and the problem is with the Group.

Yes and No :wink:
I have checked the logs and there is no entry that the rule was fired.
And I have tried to run it via the GUI and the rollershutters are gone to 50%.

Anyway, I will additional add a broadcast message to my phone.
So I see if the rules does really not fire.

Thanks in the meantime.

Not exactly the same as the event you have is in lower case.
Not sure if it is case sensitive or not but in the logs it is in uppercase and mine works fine and is in upper case.

Make the event START instead of start and see if it fires.

OR you can leave the event blank and it will fire twice. Once at START and once at END.

1 Like

Thanks, have now changed it to uppercase.
Let’s see today if it is now working.

There wouldn’t be unless you make the change I suggested above.

1 Like

Create a few other rules to test with rather than trying to get just the one rule working.
You can also test with other settings so you don’t have to wait until sunset.