Astro Binding: Event triggered Start bt no light switch on

Hello,

I had install OH2 Snapshot and the Astro Binding 2.1.0.SNAPSHOT and try to switch on light if the Sunset Starts.

In the Documentation i read:

rule "example trigger rule"
when
    Channel 'astro:sun:home:rise#event' triggered START 
then
    ...
end

But if I create the rule like this:

I get an error:

The EVENT-log shows that the event ist starting:

So the item is working… but what is wrong with my rule? What i have to change?

Thank you for your help…
Dennis

No idea?

I tried several things, but nothing is working. It is fustrating.

my items:

my current rule:

also today the event log shows, that the event channel is triggered START

If i put the switch “Sunset_Event” into the sitemap and toggle manually - the light is switching on… but Openhab don’t do it automaticly :frowning:

BR
Dennis

Hi @deladus ,
you may get more answers if you use the forum formatting (as you did on the very top); it is somewhat painful for the reader to go through screenshots; just a thought,

So you know your channel is triggering from your log-files;
don’t worry too much about the designer error, unfortunately, it frequently states errors where there are none with some of the newer features (channel being one of them);

But do you know, whether your rule fires? try to add some loginfo() commands, maybe this helps.
Also search the forum for astro binding problems depending on which snapshot version you are there have been a few problems that were introduced and resolved recently and there are still a few unresolved issues about channel triggering and rules not firing (seems a very recent issue).
Hope that helps

Just a thought but if you item is a DIMMER then the command ON will not work. Try sendcommand(RgbwwColorZone1_Brightness, 100). I have the large X on my Channel line too, but everything works.

Hi,

Thank you for your help, but i disagree: the Command

sendcommand(RgbwwColorZone1_Brightness, ON)

is working fine! If i install a Switch into my sitemap and change the “when”-vaiable to this Switch item, then the light is switching on (set brightness to 100) with this rule, if i use this item! So here is no mistake! But i will try it with your Tip to use “100” instead of “ON”

But if your example is working my you can post it to me (incl. Things, Item and Rule - configuration) my i am able to find my fault!?

But i will try it today with the Channel

Channel 'astro:sun:home:rise#event' triggered START

And i will ignore the Error-Message! My it works on my side also…

@lipp_markus My rule is not firing if the event channel is triggered START - exacly here should my problem! That this event seems not linked to the this event! But i don’t know why…

So for summarizing and using the community formating:

Here my current things:

astro:sun:home  [ geolocation="xx.097227,x.128998", altitude=46, interval=60 ]
astro:moon:home [ geolocation="xx.097227,x.128998", interval=60 ]

My Items:

DateTime Sunrise_Time       "Sonnenaufgang [%1$tH:%1$tM Uhr]" { channel="astro:sun:home:rise#start" }
DateTime Sunset_Time        "Sonnenuntergang [%1$tH:%1$tM Uhr]" { channel="astro:sun:home:set#start" }
Number   Azimuth            "Richtungswinkel" { channel="astro:sun:home:position#azimuth" }
Number   Elevation          "Erhebungswinkel" { channel="astro:sun:home:position#elevation" }
String   MoonPhase          "Mondphase [MAP(de.map):%s]" <moon> { channel="astro:moon:home:phase#name" }
Number   Total_Radiation    "Strahlung" { channel="astro:sun:home:radiation#total" }
Number   Diffuse_Radiation  "Diffuse Strahlung" { channel="astro:sun:home:radiation#diffuse" }

Switch	 Sunset_Event		"Sonnenuntergang" { channel="astro:sun:home:set#event"}

String   Zodiac             "Tierkreiszeichen [MAP(de.map):%s]" <sun> { channel="astro:sun:home:zodiac#sign" }
String   DayPhase           "Tageszeit [MAP(de.map):%s]" { channel="astro:sun:home:phase#name" }

Please notice i also tried with:

Switch	 Sunset_Event		"Sonnenuntergang" {astro="planet=sun, type=set, property=start"}

But also without any success.

Here my current rule:

rule "example trigger rule"
when
    Item Sunset_Event received update ON
then
    sendCommand(RgbwwColorZone1_Brightness,ON)
end

Yesterday, the Event Trigger als also triggered to Start!

2017-06-24 21:51:00.005 [ChannelTriggeredEvent     ] - astro:sun:home:daylight#event triggered END
2017-06-24 21:51:00.006 [ChannelTriggeredEvent     ] - astro:sun:home:set#event triggered START

BUT there is no event where I can see that my item switch “Sunset_Event” will change to “ON” So the rule will not start! Normaly every state-change of the switch will logged into event - so i guess, that my mistake is in the when variable.The rule is not starting because the rule condition seems unfulfilled.

BR
Dennis

An additional Question:
is there any way to simulate:

2017-06-24 21:51:00.006 [ChannelTriggeredEvent     ] - astro:sun:home:set#event triggered START

That i don’t have to way till the Event is triggered to start if the condition is fulfilled? It’s very complicated to test the rules if i must wait for the triggeredEvent, further because this event comes only one time a day :slight_smile:

HI @deladus

Silly question: did you upgrade to the latest snapshot, I understand that there were some malfunctions in recent builds (just search the forum for “astro not triggering” or similar). If not, you may want to do this first. users of older snapshots from a few days ago seem to have had the exact same problem.

Here a few more thoughts:
Using the format sendCommand(RgbwwColorZone1_Brightness,ON)
often works and occasionally gives problems as it is a very generic method to send commands.
All items have a more specific method RgbwwColorZone1_Brightness.sendCommand(ON)
which will work much more reliable. Not sure it makes a difference here, but it the generic function can lead to odd behavior[quote=“deladus, post:6, topic:30401”]
is there any way to simulate:

2017-06-24 21:51:00.006 [ChannelTriggeredEvent ] - astro:sun:home:set#event triggered START
[/quote]

You have a switch Switch Sunset_Event "Sonnenuntergang" {channel="astro:sun:home:set#event"}
You could try to put this switch on your sitemap where you can manually trigger it, which in turn should fire your rule.

Finally, again, just for your consideration, I have learned to sprinkle a general helping of logInfo statements in my rules when I run into difficulties. Doing this has helped a great deal to differentiate whether the bode of a rules is entered but the commands in the rule had an issue or vice versa…i had some surprising learnings…but I am not so experienced…

Hi @lipp_markus

view minutes ago i installed the latest snapshot of OH2 via openhabian-config - so i must wait till the triggered event is started… or do you mean something different?

I put already the Switch Sunset_Event "Sonnenuntergang" {channel="astro:sun:home:set#event"} into my sitemap - this switch is working from the beginning, if i use it manually - therefore I am sure that the problem is not in my rule! The rule is working very well, manually … But, like I already written, the Triggered Event of the astro:sun:home:set#event is not toggling this switch! That is, what i try to explain with my simple english.

No worries about your English, I too, as most people here on the forum, speak English as second language only.
Apologies that I missed the part about you putting the switch on your sitemap already.

Unfortunately, I do not know of any way to manually trigger a sunset event in astro. But with the updated snapshot it should hopefully work, as others had the same issue and it seem to have been resolved recently.

No Problem for this!

I will try your tips (also from @jcf6288) and come back with an update.

Good news! Now it works! The Light was switching on after astro:sun:home:set#event was triggered START. @jcf6288 has right the rules give an Error in the line with the channel “command” but it works…

Now i must try to use offset in order that the light switch on a bit earlier like the Sunset_Event is triggered start. But ths first step is done.

For Every body who has the same problem hier my working rule…

rule "Licht an bei Sonnenuntergang"
when
    Channel 'astro:sun:home:set#event' triggered START //When the [ChannelTriggeredEvent     ] - astro:sun:home:set#event triggered START
or
	Item Sunset_Event received command ON //Second condition is for Testing the rule independent of the ChannelTriggeredEvent above
then
    sendCommand(RgbwwColorZone1_Brightness,100)
end

@jcf6288 do you use the offset like this way? That means if you use the offset in generally?!

astro:sun:home  [ geolocation="xx.097227,x.128998", altitude=46, interval=60 ] {
    Channels:
        Type rangeEvent : set#event [
            offset=-20
        ]
}

Because I get here also a notify that the code is wrong!

So, i was very happy, that everything was working. But since yesterday evening the Astro Binding execute no ChannelTriggeredEvent for “astro:sun:home:” TheEvent Channels are disapear.

Before the Event was logged as:

2017-06-27 21:31:00.028 [ChannelTriggeredEvent     ] - astro:sun:home:set#event triggered START
.
.
.
2017-06-27 21:51:00.008 [ItemStateChangedEvent     ] - DayPhase changed from DAYLIGHT to SUN_SET

Running with this Condition:

astro:sun:home  [ geolocation="xx.097227,x.128998", altitude=46, interval=60 ] {
    Channels:
        Type rangeEvent : set#event [
            offset=-20
        ]
}

Everything is right! But this was the last time where astro:sun:home:#event* are triggered

Since yesterday evening It get no “ChannelTriggeredEvent” for the “sun” only “ItemStateChangedEvent”

2017-06-28 21:51:00.008 [ItemStateChangedEvent     ] - DayPhase changed from DAYLIGHT to SUN_SET

On the Monring of the 28.06.2017 the “ChannelTriggeredEvent” will only triggered for astro:moon:home … #Events but not for astro:sun:home: … #Events

BUT all Items are changing his “status” the Binding updated the Sunrise and Sunset Time and triggered also that:

.
.
.
2017-06-28 23:53:00.025 [ChannelTriggeredEvent     ] - astro:sun:home:astroDusk#event triggered START
.
.
.
2017-06-29 00:00:00.107 [ItemStateChangedEvent     ] - Sunrise_Time changed from 2017-06-28T05:24:00.000+0200 to 2017-06-29T05:25:00.000+0200
2017-06-29 00:00:00.145 [ItemStateChangedEvent     ] - Sunset_Time changed from 2017-06-28T21:51:00.000+0200 to 2017-06-29T21:51:00.000+0200
.
.
.

So, i looks everything good expect the most “astro:sun:home:***#event” for my needed…

2017-06-27 21:31:00.028 [ChannelTriggeredEvent     ] - astro:sun:home:set#event triggered START

Please notice, vrom 27.06. till 28.06. i nothing change in my configuration on 28.06.2017 afternoon i change the offset of my astro.things from -20 to -30 and wrote some rules i changed nothing in case if items or something else!

Further restart of the systems was not solving this issue. Has anybody any idea?

See here - seems to be a general problem that has to do with scheduling:
https://community.openhab.org/t/astro-binding-problem-events-do-not-trigger-multiple-triggers-solved/30320

Yes it seems a general problem. I find out that after restart it working again for exactly 7 Days than the same issue - no Event triggered!

but i was founding no solution for this phennomenon!? Or i over read it?