Alternate between two input_select options every 5 minutes

I don’t use hassio, so this might not be accurate, but from the quickest of searches the correct way to reboot should hopefully be…

Hassio > System > Reboot

Ugh, that’s crap.

Can you paste the error log somewhere again?

OK, here in a box…

#automations
  - alias: Holiday Lights Off At Midnight
    initial_state: on 
    trigger:
      at: '23:59:59'
      platform: time
    action:
      service: light.turn_off
      entity_id: light.holiday_lights

  - alias: Holiday Lights On At Sundown
    initial_state: on
    trigger:
      event: sunset
      offset: -00:45:10
      platform: sun
    action:
      service: input_select.select_option
      data:
        entity_id: input_select.holiday_led_effect
        option: Halloween 

  - alias: Swap led effects 
    initial_state: on 
    trigger:
      platform: time 
      seconds: '/5'
    condition:
      condition: state
      entity_id: light.holiday_lights
      state: 'on' 
    action:
      service: input_select.select_option
      data_template:
        entity_id: input_select.holiday_led_effect
        option: >
          {% if is_state('input_select.holiday_led_effect' , 'Halloween') %} Punkin
          {% else %} Halloween {% endif %}

And here in a gist…

Awesome :slight_smile:

LMK how you get on when you can post again :laughing:

So, the automation will trigger every 5 minutes to toggle the input_select, but only when the light is on.

So if you turn that light on now, at some point in the next 5 minutes the input_select will change and the led effects will change, then 5 minutes later the same again, and every 5 minutes until either you switch the light off, or the automation does it for you at midnight.

Then they’ll go on again at sundown, and toggle every 5 minutes etc.

My pleasure :+1:

1 Like