Cant get input_select working

I want to have an automation triggered by input_select but cant get it to work.

automations.yaml:

  • alias: ‘God morgon’
    initial_state: true
    trigger:
    • platform: template
      value_template: ‘{{ states.sensor.time.state == states.input_select.wake_up_time.state }}’

input_selects.yaml:
wake_up_time:
name: ‘Alarm soluppgång’
initial: “07:00”
options:
- “00:00”
- “00:15”
- “00:30”
- “00:45”

sensor.yaml:

  • platform: time_date
    display_options:
    • ‘time’
    • ‘date’
    • ‘date_time’
    • ‘time_date’
    • ‘time_utc’
    • ‘beat’

Oh, best to use the code formatting tool. It’s </> in the comment tool box (select the text and click the </> over it)

Otherwise there’s no way to know if it’s the code formatting or not.

#automations.yaml:
- alias: 'God morgon'
  initial_state: true
  trigger:
  - platform: template
    value_template: '{{ states.sensor.time.state == states.input_select.wake_up_time.state }}'

	
#input_selects.yaml:
#alarm / soluppgång
  wake_up_time:
    name: 'Alarm soluppgång'
    initial: "07:00"
    options:
      - "00:00"
      - "00:15"
      - "00:30"
      - "00:45"

#sensor.yaml:	  
# time
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'time_date'
      - 'time_utc'
      - 'beat'

You would probably be better off reading thru’ this thread…

It’s quite long but will help you to understand what’s needed :slight_smile:

It was actually from that thread i got this :slight_smile:

I want to replace the static time (07:00) with input_select.
Current working automation:

- alias: 'God morgon'
  initial_state: true
  trigger:
  - platform: time
    at: 07:00:00
  - platform: state
    entity_id: group.all_devices
    to: home
  condition:
  - condition: state
    entity_id: group.all_devices
    state: home
  - condition: state
    entity_id: input_select.status_hemma
    state: 'Hemma'
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:

The following works in the templates editor…
{{ states.sensor.time.state == states.input_select.wake_up_time.state }}
with the …

wake_up_time:
  name: Alarm wakeup
  options:
    - "20:00"
    - "20:15"
    - "20:30"
    - "20:45"
  initial: "20:15"

This differs from yours as I specify the hours and the minutes.

Still cant figure out why it is not working

Automation:
    - alias: 'God morgon'
      initial_state: true
      trigger:
    #  - platform: time
    #    at: 07:00:00
      - platform: template
        value_template: '{{ states.sensor.time.state == states.input_select.wake_up_time.state }}'
      - platform: state
        entity_id: group.all_devices
        to: home
      - plattform: state
        entity_id: input_boolean.alarmstatus
        state: on
      condition:
      - condition: state
        entity_id: group.all_devices
        state: home
      - condition: state
        entity_id: input_select.status_hemma
        state: 'Hemma'
      - condition: time
        weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
      action:

Input_select:
#alarm / soluppgång
  wake_up_time:
    name: 'Alarm soluppgång'
    initial: "07:00"
    options:
      - "00:00"
      - "00:15"
      - "00:30"
      - "00:45"
      - "01:00"
      - "01:15"
      - "01:30"
      - "01:45"
      - "02:00"
      - "02:15"

input_boolean:
      alarmstatus:
        name: Wake Me Up
        initial: off
        icon: mdi:alarm-check

It’s because you are specifying two different things an initial state of the input_select as “07:00” and expecting the program to realise that you want to add an offset to the initial state and compare that, well it won’t do that! Did you not read what I posted above?
- “20:00”
- “20:15”
- “20:30”
- “20:45”

This two lines arent used if they have hash marks in front?
# - platform: time
# at: 07:00:00

Or are you referring to this line?:
initial: “07:00”

Input_select:
#alarm / soluppgång
  wake_up_time:
    name: 'Alarm soluppgång'
    initial: "07:00"
    options:
      - "00:00"
      - "00:15"
      - "00:30"
      - "00:45"
      - "01:00"
      - "01:15"
      - "01:30"
      - "01:45"
      - "02:00"
      - "02:15"

This won’t work the way you seem to think it will as above I specified the exact hr and min not an inital start and an offset.

You know you don’t have an action defined, right?

Hmm I assumed that was not there because he didn’t want to clutter the output :stuck_out_tongue:

1 Like

I have several actions defined :slight_smile:

Which could be true, but then what if the problem with the automation is actually in the action and we could tweak the triggers until we’re old and grey and still get nowhere :wink:

Here’s an idea…

Post your code.

easy way to test the actions is to trigger it manually, does it work if you click the automation in the frontend then click trigger?

I will try and remove the line " initial: “07:00”
All the actions are working with this triggers and conditions:

Automation:
    - alias: 'God morgon'
      initial_state: true
      trigger:
      - platform: time
        at: 07:00:00
      - platform: state
        entity_id: group.all_devices
        to: home
      condition:
      - condition: state
        entity_id: group.all_devices
        state: home
      - condition: state
        entity_id: input_select.status_hemma
        state: 'Hemma'
      - condition: time
        weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
      action:

The above should be …

Input_select:
#alarm / soluppgång
wake_up_time:
name: ‘Alarm soluppgång’
initial: “07:00”
options:
- “07:00”
- “07:15”
- “07:30”
- “07:45”
- “08:00”
- “08:15”
- “08:30”
- “08:45”
- “09:00”
- “09:15”

etc etc.

Ah, so it’s a secret. :zipper_mouth_face:

Ok. Is it OK to tell us if you have a time sensor somewhere in your configuration?

Is it OK to tell us if @keithh666 's suggestion worked 3 hours ago?