Scene setting wrong input_select in automation for some reason

Hi. I have the following automation:

alias: >-
  Increase ventilation mode when high CO2 or Humidity detected - With scenes
  (Duplicate - doesn't work)
description: Triggers max mode for N minutes, then return back
trigger:
  - type: value
    platform: device
    device_id: eca8624df19c2feb8152557453625823
    entity_id: sensor.mh_z19_co2_value_2
    domain: sensor
    above: 1000
condition:
  - condition: state
    entity_id: group.tenants
    state: home
action:
  - data:
      scene_id: ventilation_mode_revert
      snapshot_entities:
        - input_select.ventilation_mode
    service: scene.create
  - service: input_select.select_option
    data:
      option: max
    target:
      entity_id: input_select.ventilation_mode
  - delay:
      hours: 0
      minutes: 0
      seconds: 40
      milliseconds: 0
  - data:
      entity_id: scene.ventilation_mode_revert
    service: scene.turn_on
mode: single

but for some reason, it doesn’t reset it to the original ventilation_mode afterwards, but puts in “low” :frowning: . Here is the logbook where you can see it somehow messes that up:

Any hints anyone?

I’m not sure why it behaves that way but you simply want to store/restore the state of input_select.ventilation_mode then it doesn’t require the use of a scene and can be done with a variable.

alias: Increase ventilation mode when high CO2 or Humidity detected
description: Triggers max mode for N minutes, then return back
trigger:
  - platform: numeric_state
    entity_id: sensor.mh_z19_co2_value_2
    above: 1000
condition:
  - condition: state
    entity_id: group.tenants
    state: home
action:
  - variables:
      vm: "{{ states('input_select.ventilation_mode') }}"
  - service: input_select.select_option
    target:
      entity_id: input_select.ventilation_mode
    data:
      option: 'max'
  - delay: '00:00:40'
  - service: input_select.select_option
    target:
      entity_id: input_select.ventilation_mode
    data:
      option: '{{ vm }}'
mode: single
2 Likes

Thank you, I didn’t know that, it works. Nevertheless, I still believe there’s something fishy going on with the scenes and would say it’s a bug.

There could very well be a problem. Here is a similar open issue where a climate device is not being restored correctly.

You could add your details, which would point to a wider issue with the scene create/restore services.

1 Like

Yeah, sounds very much related.

Glad to hear it works and provides a workaround for the issue with snapshot scenes.

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information refer to guideline 21 in the FAQ.

I actually marked that and then unmarked because it’s not solving the original problem, it’s rather a workaround… But I am gonna mark it us such for the simplicity

Yes, it’s an alternative means of achieving your goal to restore the climate entity’s state.

There doesn’t appear to be anything wrong with the way you are storing/restoring the snapshot_scene so its failure implies it has a bug. Therefore your choices are to wait for it to be corrected or use another method.