Alarm Clock / Morning Routine - setting time

@binderth’s approach is solid and will work. However I think it’s better to use a DateTime Item instead.

Use a DateTime Item.

Then create “default X widget” metadata using an input widget and set the “type” to “time”.

For example:

value: oh-input-card
config:
  outline: true
  clearButton: true
  inputmode: text
  footer: =items.Default_Bed.displayState
  placeholder: hh:mm:ss
  calendarParams:
    dateFormat:
      hour: numeric
      minute: numeric
    timePicker: true
  title: Default Bed time
  type: time
  sendButton: true

or as a List Item card:

value: oh-input-item
config:
  outline: true
  inputmode: text
  subtitle: =items["Default_Bed"].state
  placeholder: =items[props.item].state
  title: Default Bed Time
  type: time
  sendButton: true

These both will give a nice time picker widget when clicked on.

Note, there was an issue with time for the input widget type in 4.0 so you might need to use the latest 4.1 milestone (or the release which is happening next week I think) for this to work I think.

You can use a Time Event trigger with “at time specified in the state of an item” and toggle “time only” so it ignores the date to trigger the rule. Configure Ephemeris to define the weekends/workdays and use an Ephemeris Schedule condition so the rule only runs on work days.

This approach lets non-admin users change the time of the alarm through MainUI or gives you the option to populate the alarm time from some other source if you want (iCal, Andorid alarm, etc.). Something personal like an alarm time is something that should be exposed to end users, not just admin users.

I don’t think a scene will work well for this. @Daniel_Hermann1 wants to gradually increase the brightness over time and a Scene isn’t going to be able to handle that. But definitely look at Simulate Sunrise for how to do the gradual bring up or down the brightness on a light. It’s a good place to start at least.

1 Like