Trying to get an automation to start at a time from input_number sliders

Input_sliders.yaml

lights_hour_on_1:
  min: 0
  max: 23
  name: Hour on
  step: 1
  mode: slider
  unit_of_measurement: Hour
  icon: mdi:clock
lights_minute_on_1:
  min: 0
  max: 59
  name: Minute
  step: 15
  mode: slider
  unit_of_measurement: Minute
  icon: mdi:clock
lights_duration_minutes_1:
  min: 15
  max: 3600
  name: Minutes to off
  step: 15
  mode: box
  unit_of_measurement: Minutes
  icon: mdi:clock

Automations.yaml

- alias: Living Room Lamps On
  id: lrlon
  trigger:
  - platform: time
    data_template:
    after: '{{states.input_number.lights_hour_on_1 | int}}:{{states.input_number.lights_minute_on_1" | int}}:00'
  action:
  - service: homeassistant.turn_on
    data:
      entity_id: fan.fan_1

I’ve tried various variations of {{states.input…etc
ie. same as above but .state after the lights_hour_on_1 and lights_minute_on_1
tried with and without the | int and a couple of other things.
There’s something there that I’m not understanding, appreciate any help.

I also want to cause a delay after the fans (lights) have been turned on before they are then turned off, I have another input slider for the duration not included in the above/current non-working automation.

Thanks, Mark

How about this to take out some of the hurdles:

And these to use in a script for the duration part:

I actually got a bit further on with the below which validates but doesn’t seem to trigger (thanks to here: Creating a alarm clock). Will have a look at @Bit-River suggestion but hoped to keep it as simple as possible.

    - alias: Living Room Lamps On
      id: lroomlightson
      trigger:
      - platform: template
        value_template: '{{ now.time().strftime("%-H") == (states.input_number.lights_hour_on_1.state | int) and now.time().strftime("%-M") == (states.input_number.lights_minute_on_1.state | int) }}'
      action:
      - service: homeassistant.turn_on
        data:
          entity_id: fan.fan_1
      - service: persistent_notification.create
        data:
          message: Fan 1 should have just come on. 
1 Like

Hi Mark Van Bellen,
Did you get this to work with the input_number as trigger for time?

There’s an extra quotation mark there, after minute_on_1, unless it should be there :blush: