Cant get input_select working

It should be …
to: ‘on’

Your indentation looks wrong to me to, everything under the t of trigger should be under the i of trigger

That worked.

Thank you @keithh666 and @anon43302295 :bowing_man:

Hmm noticed that the automation started even though i had input_boolean.coffeornot off

- alias: 'Kaffe på morgonen under helgen'
  initial_state: true
  trigger:
  - platform: template
    value_template: '{{ states.sensor.time.state == states.input_select.coffemaker.state }}'
  - platform: time
    at: 08:30:00
  - platform: state
    entity_id: input_boolean.coffeornot
    to: 'on'
  condition:
  - condition: state
    entity_id: input_select.status_hemma
    state: Hemma
#  - condition: time
#    weekday:
#    - sat
#    - sun
  action:
  - service: homeassistant.turn_on
    entity_id: switch.net_perkulator

Yes because the triggers are not AND they are any change in state of a trigger will trigger it so in your case if the time is correct for either of your time triggers will trigger it even if the input_bool is off.

Is it possible to have the input_boolean as a condition then?

yep you can use the state of the input_boolean as a normal state condiditon.

Example from my alarm clock…

 - alias: 'Wake Me Up'
   initial_state: 'on'
   trigger:
     - platform: time
       minutes: '/1'
       seconds: '0'
   condition:
     - condition: or
       conditions:
         - condition: and
           conditions:
             - condition: state
               entity_id: input_boolean.alarmstatus
               state: 'on'
             - condition: state
               entity_id: input_boolean.alarmweekday
               state: 'on'
             - condition: time
               weekday:
                 - mon
                 - tue
                 - wed
                 - thu
                 - fri
                 - sat
             - condition: template
               value_template: '{{ now().time().strftime("%R") == states.sensor.alarm_time.state }}'
         - condition: and
           conditions:
             - condition: state
               entity_id: input_boolean.alarmstatus
               state: 'on'
             - condition: state
               entity_id: input_boolean.alarmweekday
               state: 'off'
             - condition: template
               value_template: '{{ now().time().strftime("%R") == states.sensor.alarm_time.state }}'

The automation didnt go on this morning

- alias: 'God morgon'
  initial_state: true
  trigger:
    - platform: time
      minutes: '/1'
      seconds: '0'
    - platform: state
      entity_id: group.all_devices
      to: home
  condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
         - condition: state
           entity_id: input_boolean.alarmstatus
           state: 'on'
         - condition: state
           entity_id: input_boolean.alarmweekday
           state: 'on'
         - condition: time
           weekday:
            - mon
            - tue
            - wed
            - thu
            - fri
            - sat
         - condition: template
           value_template: '{{ now().time().strftime("%R") == states.sensor.alarm_time.state }}'
      - condition: and
        conditions:
         - condition: state
           entity_id: input_boolean.alarmstatus
           state: 'on'
         - condition: state
           entity_id: input_boolean.alarmweekday
           state: 'off'
         - condition: template
           value_template: '{{ now().time().strftime("%R") == states.sensor.alarm_time.state }}'
         - condition: state
           entity_id: input_select.status_hemma
           state: 'Hemma'
  action:

image

Please forgive me :blush:

I copied the example without changing the name of the input_select in value_template

@keithh666 i still cant get it to work

- alias: 'God morgon'
  initial_state: true
  trigger:
    - platform: time
      minutes: '/1'
      seconds: '0'
  condition:
      - condition: and
        conditions:
         - condition: state
           entity_id: input_boolean.alarmstatus
           state: 'on'
         - condition: template
           value_template: '{{ now().time().strftime("%R") == states.sensor.wake_up_time.state }}'
         - condition: state
           entity_id: input_select.status_hemma
           state: 'Hemma'
  action:

What does the above look like now?

I assume this is the state:

#alarm / soluppgång
  wake_up_time:
    name: 'Alarm soluppgång'
    icon: mdi:alarm-multiple
    options:
      - "00:00"

Can you show it all please? All of that sensor that is.

#alarm / soluppgång
  wake_up_time:
    name: 'Alarm soluppgång'
    icon: mdi:alarm-multiple
    options:
      - "00:00"
      - "00:15"
      - "00:30"
      - "00:45"
      - "01:00"
      - "01:15"
      - "01:30"
      - "01:45"
      - "02:00"
      - "02:15"
      - "02:30"
      - "02:45"
      - "03:00"
      - "03:15"
      - "03:30"
      - "03:45"
      - "04:00"
      - "04:15"
      - "04:30"
      - "04:45"
      - "05:00"
      - "05:15"
      - "05:30"
      - "05:45"
      - "06:00"
      - "06:15"
      - "06:30"
      - "06:45"
      - "07:00"
      - "07:15"
      - "07:30"
      - "07:45"
      - "08:00"
      - "08:15"
      - "08:30"
      - "08:45"
      - "09:00"
      - "09:15"
      - "09:30"
      - "09:45"
      - "10:00"
      - "10:15"
      - "10:30"
      - "10:45"
      - "11:00"
      - "11:15"
      - "11:30"
      - "11:45"
      - "12:00"
      - "12:15"
      - "12:30"
      - "12:45"
      - "13:00"
      - "13:15"
      - "13:30"
      - "13:45"
      - "14:00"
      - "14:15"
      - "14:30"
      - "14:45"
      - "15:00"
      - "15:15"
      - "15:30"
      - "15:45"
      - "16:00"
      - "16:15"
      - "16:30"
      - "16:45"
      - "17:00"
      - "17:15"
      - "17:30"
      - "17:45"
      - "18:00"
      - "18:15"
      - "18:30"
      - "18:45"
      - "19:00"
      - "19:15"
      - "19:30"
      - "19:45"
      - "20:00"
      - "20:15"
      - "20:30"
      - "20:45"
      - "21:00"
      - "21:15"
      - "21:30"
      - "21:45"
      - "22:00"
      - "22:15"
      - "22:30"
      - "22:45"
      - "23:00"
      - "23:15"
      - "23:30"
      - "23:45"
# lägg till följande för att få en dropdown list med  val
  status_hemma:
    name: 'Om vi är hemma'
    icon: mdi:panda
    options:
     - 'Semester'
     - 'Hemma'
# time
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'time_date'
      - 'time_utc'
      - 'beat'
    scan_interval: 30

These are all input_selects are they not?

  alarmstatus:
    name: 'Väckning'
#    initial: off
    icon: mdi:alarm-check

Yes it is input_selects input_booleans and sensors

What’s happened here is that you’ve copied part of my alarm which uses a slightly different way of doing it as I calculate my times from an input slider hence my comparison is with sensors not input_selects, you need to change the wakeup sensor to an input_select…

       value_template: '{{ now().time().strftime("%R") == states.input_select.wake_up_time.state }}'
1 Like