Enabling evening Mode

Hey Guy´s

I am looking for simple automation that will enable Evening mode, the below does not seem to work :frowning:

Evening mode ==== 1 hrs before sunset and sun elevation > -18

- alias: Evening mode
  trigger:
    - platform: numeric_state
      entity_id: sensor.out_side_lux
      below: 5000
  condition:
    - condition: sun
      after: sunset
      after_offset: "-01:00:00"
    - condition: template
      value_template: '{{ state_attr("sun.sun", "elevation") > -18 }}'
  action:
    - service: input_select.set_options
      data:
        entity_id: input_select.house_mode
        options: Evening

Cheers

Rich

I haven’t used input_select before, but the documentation suggest that “options” must be a list.

Which means it should be:

    - service: input_select.set_options
      data:
        entity_id: input_select.house_mode
        options: 
          - Evening

Also, not sure what you’re trying to accomplish, but shouldn’t you be using input_select.select_option instead of input_select.set_options?

Hi Fanuch,

Thanks for highlighting the input_select.select.option. I have now changed this. I was only following the below example from the documentation. If I hit the execute button for the ^^ under the Automation tab, it will fire the action fine and set the input to the Evening.

I believe it must be something to do with the Conditions. ?

# Example configuration.yaml entry
automation:
  - alias: example automation
    trigger:
      platform: event
      event_type: MY_CUSTOM_EVENT
    action:
      - service: input_select.select_option
        data:
          entity_id: input_select.who_cooks
          option: Paulus

Not sure how the S got in option :crazy_face: :roll_eyes:

 options: 
          - Evening

looks to be working now cheers all :slight_smile: