Blueprints generate an error, but only with one input

Hi, I’m trying to make a sunrise automation and the problem (I think) is the error in the log:
homeassistant.components.blueprint.errors.MissingInput: Missing input device_input
This is shown only when the alarm sensor is set.

The whole automation work if triggered manually, but automatically not (even with the manual time).

I hope that someone could help me, Thanks in advance!

blueprint:
  name: Sunrise alarm
  description: Wake up with a lovely sunrise
  domain: automation
  input:
    target_device:
      name: Target device
      selector:
        entity:
          domain: light
    device_input:
      name: Sensor device
      selector:
        entity:
          device_class: timestamp
      default: none
    datetime:
      name: Start time
      selector:
        time:
      default: 00:00:00
    duration:
      name: Sunrise duration (s)
      selector:
        number:
          min: 60
          max: 900
      default: 60
    brightness:
      selector:
        number:
          min: 0
          max: 254
      default: 150
    write_red:
      name: Red value
      selector:
        number:
          min: 0
          max: 255
      default: 255
    write_green:
      name: Green value
      selector:
        number:
          min: 0
          max: 255
      default: 130
    write_blue:
      name: Blue value
      selector:
        number:
          min: 0
          max: 255
      default: 20

variables:
  brightnessact: 0
  durationvar: !input duration
  step: '{{ float(durationvar)*5/255 }}'
  target_light: !input target_device
  brg: !input brightness

trigger_variables:
  sensor: !input device_input
  manual_time: !input datetime
  seconds: !input duration

trigger:
  platform: template
  value_template: >-
    {{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date')
    ~ ' ' ~ manual_time) | float - as_timestamp(states('sensor.date_time_iso')) <= float(seconds)}}'

action:
  - repeat:
      while:
      - condition: template
        value_template: '{{ state_attr(target_light, "brightness") | int < brg }}'
      sequence:
      - delay: 
          seconds: '{{ float(step) }}'
      - service: light.turn_on
        target:
          entity_id: !input target_device
        data:
          brightness: '{{ state_attr(target_light, "brightness") | int + 5 }}'
          rgb_color:
            - !input write_red
            - !input write_green
            - !input write_blue
  - delay:
      minutes: 10
  - service: light.turn_off
    target:
      entity_id: !input target_device