Wanted: Change a select entity for a given time before returning to the original

I’m looking for a blueprint / automation to change a select option to a given option but only for a certain time. I’m thinking along the lines of this: Bounce Switch On A Timer which will ‘undo’ a switch after a specified time.

My use-case is my inverter which has select.work_mode. I’d like to be able to change the work mode for a fixed amount of time, after which it should return to the previous selection.

E.g.
Automation triggered.
select.work_mode is currently “self_use”
Change to ‘new’ mode. e.g. “Feed-in”
After set time e.g. 1 hour
Return to the original mode (whatever that was)

Something like this? I don’t know what you want to trigger your automation on, but this should get you started.

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - switch.<your switch>
    from: "off"
    to: "on"
    id: switch_on
  - platform: state
    entity_id:
      - timer.<your timer>
    from: active
    to: idle
    id: timer_done
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - switch_on
        sequence:
          - service: timer.start
            target:
              entity_id: timer.<your timer>
          - service: select.select_option
            data:
              option: "On"
            target:
              entity_id: select.<your select>
      - conditions:
          - condition: trigger
            id:
              - timer_done
        sequence:
          - service: select.select_option
            data:
              option: "Off"
            target:
              entity_id: select.<your select>
2 Likes

I agree with Bill. A standalone automation that just does this anytime the device it started. If there are conditions that you don’t want the auto part to fire, add that to a conditions statement.