Astro 2.2 - multiple events with different parameters

My first experience of OpenHAB is v2.2. I have slowly learned that most forum posts and some documentation refers to earlier versions with a different architecture. Some of these posts show Items being added to the items file with bindings to Astro. It looks like this allowed multiple switches to be bound to an Astro event, each with different earlier/later constraints or offsets. I was planning on using this to create specific versions of of the sunset and sunrise events for particular purposes. The earliest, latest and offset values are likely to be different for, say, window shades than they are for exterior lighting. Also, it would be convenient to add versions extra items with offsets to, say, move the window shades to a half-way position.

I can see in v2.2, the idea is to link Astro Channels to DateTime or Switch Items, then define parameter values on the Channel. This only allows a single set of parameters for the whole channel. To restore the previous functionality, I guess the obvious thing would be to allow parameters to be specified on the link between a Channel and an Item. Another option would be to allow the user to create child channels beneath the predefined channels. Am I missing another approach that already works.

I presume the only work around for now is to have my rules fire every minute and compare the current time to times from Astro, with the constraints and offsets defined within the rule. Any better ideas?

Just read the current astro docs, you can switch the versions they refer to on the top right of the screen.

You can create multiple astro things by adding those manually. Go to the inbox of PaperUI, hit the plus sign, choose the astro binding, choose sun or moon, choose a unique thing id and trigger on the newly created channels for that thing.

You’re right, the versioning feature of the main documentation is good. To revise what it said, I suppose I was more often put on the wrong path by forum posts referring to older versions. I can’t really think of a way to solve that, however.

I don’t think there’s any post or document that explicitly points out that you can add as many Astro things as you like to achieve things like this, so it’s good that there is now, thank you :grinning: In retrospect, I probably should have worked it out, but the concept of adding multiple sun things does have a slight whiff of workaround. Not as bad as running my rule every minute, however!

I have added a couple of new sun things and updated my rules, so I await sunrise with anticipation.

1 Like