Astro Binding not triggering in rules

I am testing the Astro binding on OH2 and created the following rule. I know the email is working because I have it set up the same way in other rules that are working. Am I missing something? Also I noticed in all the documentation that people usually refer to the “240daf21” as home or local. Why is that different here? When I pull up the channel for sunrise for instance I see “astro:sun:240daf21:rise#start”

rule "X"
when
        Channel 'astro:sun:240daf21:rise#start' triggered START
then
        sendMail("email@example.com","Critical Alert From OpenHab","Your Sunrise Event Just triggered X")
end

I am good data when looking at it on Paper UI.

I would guess that it’s the “240daf21” that’s wrong. Look in your logs around the rise/set time, and see what the correct location is.

PS: if you set your LAT/LONG in Openhab settings, then you can use ‘local’ in the location.

hmmm ok I see this in my logs… I will try the local thing and see what happens…

2018-04-29 16:20:27.402 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2018-04-29 16:20:28.917 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:240daf21
2018-04-29 16:20:29.074 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local

The trigger should be

when
  Channel "astro:sun:240daf21:rise#event" triggered START
then
...

The rise#start channel is just the DateTime of the sunrise, to trigger rules you use the rise#event channel.

1 Like

How would it know if I want to trigger at the start or end of the rise event for instance? They are about 3 minutes apart.

That’s what the triggered START or triggered END are for :slight_smile:

As the sun is not a dot but a circle (treated as 2D…), the sun is “passing” the boundaries, so start is first contact with boundary, end is end of contact with boundary :slight_smile:

Please be aware that the trigger is the event channel, not a time/date channel. The event channels are gray in the thing configurationUnbenannt2

Ok that clears it up! Thanks for the help. Will try this out shortly and report back.

Thanks for the clarification! Just had my first Astro triggered event! Everything worked as expected. Also I did two rules so I tested it with both the local and the “240daf21” and it worked on both!