Time intervals (like days) -- use iCalendar binding, DateTime items or smth else?

  • Platform information:
    • openHAB version: 3.2

While thinking about a heating rule (sw thermostat basically) I realized that I want a vacation mode. Moreover, I want it user-friendly if possible, not forcing others to learn cron expressions etc.

So the usecase is: someone defines a vacation start/end, OH adjusts the heating strategy for this period (stay cool most of the time, heat the house in advance). But which UI controls to use?

Could be done with iCalendar, but this looks somehow fragile: totally depends on the Calendar provider and, basically, requiers OH being online. I realize that if Google bans me I will have a bigger problems than a cold house, but still. Additionally, I will have to give the event title some semantics and I don’t see this as error-prone and robust.

I’d rather do this configuration in OH itself. Say, I could define two DateTimes, but I don’t see a way to create a UI setpoint for this type. Something like a date picker, but it seems we don’t have it. Not in default UI, not in sitemaps (hence not in mobile apps).

Am I missing something? What is the OH way to mark the date?

see DateTime List Item, DateTime Standalone Widget. Also look for other useful stuff in the Marketplace. Rule templates, UI widgets and more can be installed and used from the marketplace through MainUI.

Also look at the rule templates. Alarm Clock Rule could be used here too run a rule at the defined date time to change your vacation mode item.

So you’ll get both the UI widgets and rule for free, little to no oding required.

Thanks, Rich! I tried the widgest out, and there’s something I don’t understand. First of all, what’s the difference, why have two?

Next, the regular widget does not render at all. Did I misconfigure my UI, or is it a bug? Tried Chrome/FF/Safari, all the same.
Here’s my test page in edit mode (run mode is not much different):

The standalone widget seems to be working, the settings are propagated to the item. I see some bugs though. With the timezone, and with the rendering in non-Chrome borwsers (Firefox and Safari). How do I report them?

Look though the Getting Started tutorial and the NainUI docs and you’ll see that if you put a widget on a Layout page, you’ll use a Stand Alone Widget. When the Item is displayed as arrow inside a card widget, like is done in the cards in the Locations, Equipment, and Properties tab of the Overview page, it users a List Item widget.

Though now that most of thus widget is actually implement by the upstream F7 framework which in turn is based on the Vue framework and to sone degree by the browsers themselves. It might not be a ornament we can fix here.

I guess the question about bugs was, is OH a single product or widgets, addons etc. have their own trackers, release cycles etc.

It depends. In this particular case, the Date Time widgets are just a standard configuration of a the built in oh-input widget. All I did was supply “datetime-local” as the inputmode property of the widget. Frankly it’s hardly worth having posted it as a widget at all, but it more convenient than explaining how to do this every time.

Anyway, it’s a standard widget with a standard configuration parameter so it’ll be MainUI that implements it. However, MainUI just passes this through to F7 so the true source of the problem is likely going to be F7, Vue, or the browsers themselves.

If it were a more complicated widget, and the problem were based on how the widget were built, you’d ask for help in the Marketplace thread. If the problem were something fundamental to how MainUI works you’d file an issue on openhab-webuis. If it were specific to a binding you’d file an issue at openhab-addons. And so on.

Everything that is part of the openHAB project itself is on the same release cycle.