Link Astro2 Thing Channels?

I’m hoping to make the change over from the Astro1 to Astro2 bindings.

I installed the binding and was able to learn add custom Thing Item with an XX minute offset. And I see my new custom Things items in the PaperUI.

But to use those items in a rule, do you need to link the channels for them in the PaperUI?

I’m hoping to have my outside lights come on at XX before sunrise, and then maybe turn off at some later time. I never knew there was a ‘Dawn’ time until just now and that could come in very useful.

http://docs.openhab.org/addons/bindings/astro/readme.html

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

@sihui

Yes, I’'ve been reading that information and think have things correct and will see what happens tonight

I have created 2 items, 30 minutes before sunrise and 30 minutes before sunset. So my things file looks like this:

astro:sun:rise_minus_30   [ geolocation="xx.xxxx,-xx.xxxx", interval=60] {
    Channels:
        Type rangeEvent : rise#event [
            offset=-30
        ]
}

astro:sun:set_minus_30   [ geolocation="xx.xxxx,-xx.xxxx", interval=60] {
    Channels:
        Type rangeEvent : set#event [
            offset=-30
        ]
}

And I see those both in the PaperUI.

And my rule is as follows in testing for sunset tonight.

rule "Test BackDoor Light"
when
    Channel 'astro:sun:set_minus_30:set#event' triggered START 
then
    sendCommand(FF_Light_BackDeck, ON)
end

I think its all correct. But within PaperUI, and looking at each Item, do you need to Link each channel your using?

Sorry, did not read your whole post (I see more than 100 unread posts each day, too much to read all in detail)

I didn’t try this custom created channels yet, so we should just wait what happens during the trigger time.
Keep us up to date, a solution for that would be interesting :slight_smile:

I don’t know exactly since when, but in newer builds e.g. #723 or #741 (=newest), there you can define an OFFSET in the channel configuration via PaperUI.

Channel:

astro:sun:local:set#event

your rule then simply should be:

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