To get my OH2 installation more flexible I want not to hard code time settings. Is there any idea to pick time settings from gui into a variable?
Something like the setpoint for numbers?
And how to implement a rule which checks if the configured time is reached to do any action.
At the moment I user a cron config to reach this functionallity but this is not very flexbile. I have to edit source code to change time settings and cannot enter it via gui.
Not really. There might be a custom widget for HABPanel but for the Sitemaps you have to break the time and date into parts and use a separate slider or SetPoint for each part.
Alternatively you can set up one of the calendar based bindings and enter the schedule into your calendar.
It is a major limitation on Sitemaps.
Another approach is to base as much as possible on state and events (e.g. presence, astro events, current temperatures, etc.) rather than hard coded our configurable times.
At the moment I use a cron job with the specifice time settings.
rule "roller shutter down"
when
Time cron “0 0 6 * * ? *” or // Morning start
Item Sunrise_Event received update ON // Day start
then
RollerShutter01.sendCommand(0)
}
end
Is it possible to configure a cron job with a value of a string or something else?
rule "roller shutter down"
when
Time cron cronsettings or // Morning start by manipulating the cronsettings from a string
Item Sunrise_Event received update ON // Day start
then
RollerShutter01.sendCommand(0)
}
end
Instead I have to run a cron job every minute and check, if the specific time is reached.
The open source compatible way would be you have your customers pay for having this feature implemented in the project and not as a closed custom proprietary workaround
This approach is one of the work arounds for this. Another is to use Timers. There are a ton of Alarm Clock Examples which illustrate several approaches. Personally, I would think that using a Calendar would be the best workaround for having your customers to enter a schedule but I don’t know enough to say so definitively.
The best would be to have someone implement the feature. And if you can get your customers to pay a bug bounty that would potentially encourage someone to develop the feature sooner.