DateTime List Item

Happy to share my configs.

Widget code I am using:

uid: rlk_datetime_list
tags:
  - marketplace:127967
props:
  parameters:
    - description: Label for the widget
      label: Label
      name: label
      required: false
      type: TEXT
    - context: item
      description: An item to control
      label: Item
      name: item
      required: false
      type: TEXT
  parameterGroups: []
timestamp: Oct 5, 2022, 3:55:27 PM
component: oh-input-item
config:
  inputmode: text
  label: =props.label
  name: alarmtime
  outline: true
  sendButton: true
  subtitle: "=(items[props.item].displayState) ? items[props.item].displayState : items[props.item].state"
  title: =props.label
  type: datetime-local

Test page using the widget

config:
  label: Test
blocks:
  - component: oh-block
    config: {}
    slots:
      default:
        - component: oh-grid-row
          config: {}
          slots:
            default:
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                    - component: oh-toggle-card
                      config:
                        item: testswitch
        - component: oh-grid-row
          config: {}
          slots:
            default:
              - component: oh-grid-col
                config: {}
                slots:
                  default:
                    - component: oh-list-card
                      config: {}
                      slots:
                        default:
                          - component: widget:rlk_datetime_list
                            config:
                              label: Endzeitpunkt
                              item: HomematicIP_Thermostat_Badezimmer_Profile_Override_EndDateTime
masonry: null
grid: []
canvas: []

Item description

DateTime                    HomematicIP_Thermostat_Badezimmer_Profile_Override_EndDateTime        "Profil Soll Ende [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"              <calendar>       (gBadezimmerThermostat)                                                                                                                              ["Point","None"]                 {stateDescription="" [pattern="%1$td.%1$tm.%1$tY %1$tH:%1$tM"]}

Thereā€™s nothing in the widget config that can change this. Frankly, the only reason that I published this as a widget to the marketplace was to make writing a tutorial easier. Itā€™s a standard oh-input-item. All I did was set the type to datetime-local which is what causes it to render the date time picker. I also set the sendButton property to true.

Thatā€™s it. Thereā€™s nothing else.

This is a really lame custom widget. Thereā€™s nothing unique here. Thereā€™s nothing you couldnā€™t do yourself. All I did was set two of the documented oh-input-item properties so it shows the date time picker.

There might be something that can be done by OH (please file an issue on the openhab-webuis repo) but from what I saw, what actually renders that date time picker is not MainUI, itā€™s not even F7. As far as I can tell, itā€™s the web browser itself. So if it doesnā€™t work Iā€™m not sure thereā€™s much OH can do about it. There certainly isnā€™t anything I can do about it from the widget.

Any idea / workaround how I could enter a datetime? I have a lot of thermostats where I want to use a datetime with proper picker. Having a standalone widget would be somehow problematic.
Any workaround idea? Via popup using the standalone widget does not work as well (yet).

I doubt it. I suppose you could try to implement a whole new widget from scratch, if thatā€™s even possible. But whether you put it in a pop-up or anything else, as long as you are using an oh-input-item what you see is what you get.