Rollershutters - up@sunrise +- VALUE

Hi All. I managed to get my old rollershutters to go up and down via the habPANEL. Thanks to this awesome cummunity!

Right now i would like to let them go up at sunrise but plus or minus a value i can enter in the BasicUI or in the HabPanel.

I found this thread by @riverbin

and the great work of @gerrieg

To be clear:

I would like to let the rollershutters go UP on sunrise. When this is too early i would like to let it go up later. This should be ajustable in the Basic UI. In the Basic UI i type in the value 90 or -120 and than the shutters go up 90 minutes after sunrise or 120minutes before sunrise.

This is not going to be easy. You cannot dynamically change the offset for an Astro Thing. You cannot type a value into Basic UI.

There are ways to accomplish this though.

The problem needs to be broken down into parts.

  1. You need Number Items and Setpoints and or Sliders on the sitemap/habpanel to choose each offset.

  2. Create a rule that runs sometime after midnight and when OH restarts
    a. in this rule create a timer that goes off at sunrise + offset and another that goes off at sunset + offset
    b. the body of the timers will raise or lower the shutters respectively

Thank you for your quick reply. I hoped you would say that it is easy to config that. :frowning:



  1. When I stick to the astro bindings… just to be sure that I understand what you mean.

I create a Number Item. I will be able to adjust the value of this item in the habpanel. For example - 6 hours to + 6 hours

I will need one offset for sunrise and one for sunset. So two Number Items per rollershutter group.

  1. a. I understand that
  2. b. I dont understand that :wink:

Wow… thats really not easy. I am a complete Beginner in openHAB and Linux. I think thats a problem that i cannot solve.

Is there an easier way when i just let them go up and down at a specific time which i can change with habpanel or sitemap?

This is again this Timer thing right? Just without the astro. Timer starts at 0:00 and i can adjust it with a slider.

haha i think i am game over here…

I looked through the bindings and found that astro1 binding. Isnt this what i was looking for?

I found this:

// schedules a event which starts 30 minutes BEFORE sunset:
Switch Sunset_Event {astro=“planet=sun, type=set, property=end, offset=-30”}

and I replace offset=-30 with a variable which i adjust with a habpanel slider?

You can’t do that and that is why this is not easy to accomplish and why you have to use Timers. The Astro offset, whether in the Astro 1.x binding or the Astro 2.x binding is hardcoded and cannot be changed at runtime.

But while I say it is hard, it really isn’t all that hard.

But first, before I go into putting together an example, what is it you are really trying to accomplish? Can you accomplish it using events and state (e.g. in the winter use a minus 120 minutes, in summer use a minus 30 minutes).

Sure, I will first try it myself. But this might take a while.

I think, I will first try to use a timer without the astro thing.

Thanks for your help. I really appreciate it