Updating rule trigger time from another rule

Hi all,

This is my first post and I am new to Openhab and I started with a fresh install of OH3 so have no configuration files to migrate. At this point I am only using the UI to configure the system and have made reasonable progress.

I have a rule that can extract the SunSet time from an Astro sunset item. What I am trying to figure out , is it possible in the rule script to access and update the trigger time of another rule? The second rule would be used to switch on a light at Sun Set or perhaps at an offset time.

My plan was to trigger the first rule when the Astro items update, normally at local midnight.

I know I can do this by having a rule that polls the various times to switch on the light, but I feel if it is possible the other solution may be neater.

Thanks for any suggestion or other solutions anyone may give.

Ernie

Maybe this:

HI Greg,

I think you have the same issue as me. Let me know if you get a solution.

Ernie

No click on the link. It’s a suggestion.
I don’t have a problem.

Hi Greg,

Sorry, I miss understood your email, I am new to this!
Thanks I'll have a look at your link.

Ernie

It’s possible but as a beginner that’s not likely something you’ll want to do and instead find another way. For example:

  • the already mentioned offset parameters in the Astro binding itself Greg linked to
  • Timers
  • Thread.sleep

The easiest will be to use the offset parameter on the Thing.

Why not use the sunset trigger channel?

Did the suggestion solve your problem?
If so mark it as the solution.
Thanks

Hi Greg,

Yes, I think I have a better understand how things work now. I still need to play around with it to make sure I fully understand it.

Thanks for you help.

Ernie

Hi Anders

Thanks for you help.

Ernie

Hi Rich,

The pointers Greg give me has helped my understanding on how it works.

Thanks for you help.

Ernie

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.