Using Timepick and Sensor to set wakeup alarm

Hello everyone,

I’ve been trying to set up a timestamp sensor for my needs for a few days now.

The origin is the implementation of the blueprint:

This requires a sensor with a timestamp:

I have set up a helper for this and built the following card:

grafik

type: vertical-stack
cards:
  - type: markdown
    content: '## Wecker'
  - type: horizontal-stack
    cards:
      - type: vertical-stack
        cards:
          - type: vertical-stack
            cards:
              - type: markdown
                content: >-
                  ### {{ as_timestamp(states("sensor.alarm_time_paul") |
                  as_datetime | as_local) | timestamp_custom('%d.%m.%Y - %H:%M
                  Uhr') }}
              - type: entities
                entities:
                  - entity: automation.paul_wecker
                    icon: mdi:bed-clock
                    name: 'Wecker '
      - type: custom:time-picker-card
        entity: input_datetime.paulsetwecker
        hour_mode: 24
        hour_step: 1
        minute_step: 15
        layout:
          hour_mode: double
          align_controls: center
          name: header
          embedded: false
          thin: true
        hide:
          seconds: true
          icon: false
          name: false
        name: Weckzeit einstellen
        link_values: false
  - type: markdown
    content: Wenn ausgeschaltet, erfolgt keine Erinnerung an das Wiegen

My sensor in the configuration looks like this:

template:
  - sensor:
      - name: "alarm_time_paul"
        state: '{{ states("input_datetime.PaulSetWecker") | as_datetime | as_local }}'
        device_class: timestamp

The intention is that when the alarm time is selected, this time is set for the next day and is also automatically active for all subsequent days. I have specified a workday sensor accordingly in the blueprint and manual deactivation is possible using a switch.

My problems, and I’m hoping for help because I don’t know how to go about this:

a) When selecting the time using the timepicker, not only the time should be set, but also the next days or even 24 hours (86400 seconds) should be added.

b) The timestamp must always be set automatically for the next day. I think this is where I need to start with the sensor, but I honestly don’t know how.

Many thanks in advance for your help

Chris

Half solved, for the winter time changeover I have to adjust something again. It would be nice if this worked every 6 months without any adjustments.