Select_Option with sensor input

Hi

I want to create an automation that starts the dishwasher delayed. I want to do this on a specific method so that the timer is in the dishwasher and not dependent on HA when first activated. I have most of it set up and tested. My only problem is, that i don’t know how to input a sensor value to the select_option

  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: select
    entity_id: 54302fe98b4c69a9b219510153d41dc8
    type: select_option
    option: '3:00'

It works as in the above example with a fixed ( in the example 3:00) delay.

I have a sensor (called dishwasher_delayed_option) with the value as an int that i want instead of the fixed value.

For information I’m using Home Connect Alt for the integration with the dishwasher. Text

Hi swiim,

If you want to do that, look at entity_ids and states, because device_id don’t support much if anything for templates.
Why and how to avoid device_ids in automations and scripts.

1 Like

You will need to use templates in a select.select_option action, not a Device action. Device actions are meant for basic uses and do not support advanced features like templates.

You will need to clarify what you mean here… does the integer represent the minutes, seconds, or something else?

Yes the integer represents the option with the delayed time HH:MM. 00:00, 0:30, 1:00, 1:30 ect. to 24:00. It will contain the one desired compared to the current time.

Hi @Sir_Goodenough

I did use the automation wizard as I’m not prone to programming. The wizard does not allow entity as actions. Can you help me with an example? The entity is named select.gaggenau_df270160f_68a40e0c737b_bsh_common_option_startinrelative

Could something like this be an viable way, or maybe format the senser accordingly and put it directly in the select.option some how?

action:
      - service: select.select_option
        target:
          entity_id: select.gaggenau_df270160f_68a40e0c737b_bsh_common_option_startinrelative
        data:
          option: "{{ states('dishwasher_delayed_option') }}"

Tried to swich out the part with an select.select_option but gets following error

bad indentation of a mapping entry (156:17)

153 |     type: press
 154 |   template:
 155 |       - service: select.select_option
 156 |           target:
-----------------------^
 157 |             entity_id: select.gaggenau_df270160 ...

The complete code looks like:

- id: '1728496840587'
  alias: Opvaskemaskine fjernstart automatisk ved billig strøm
  description: ''
  triggers:
  - type: turned_on
    device_id: b12c69c35cee6f3d260ca600a358ae0e
    entity_id: adf9aa7f25baba5706961053b7079abf
    domain: binary_sensor
    trigger: device
  - type: not_opened
    device_id: b12c69c35cee6f3d260ca600a358ae0e
    entity_id: 8f4bd066ffe1e89533b06319117abeff
    domain: binary_sensor
    trigger: device
    for:
      hours: 0
      minutes: 0
      seconds: 2
  conditions:
  - condition: device
    type: is_on
    device_id: b12c69c35cee6f3d260ca600a358ae0e
    entity_id: 73f49a6813bd3ce8d1cac20eef6d1395
    domain: switch
  actions:
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: button
    entity_id: 847ec15803cd65efdbdbd98205aee285
    type: press
  template:
      - service: select.select_option
          target:
            entity_id: select.gaggenau_df270160f_68a40e0c737b_bsh_common_option_startinrelative
          data:
            option: "{{ states('dishwasher_delayed_option') }}"
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: select
    entity_id: 7f5ab0da8ca0e01020a717be731513bf
    type: select_option
    option: Dishcare.Dishwasher.Program.Eco50
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: button
    entity_id: 5d58f8235aa1ab80eb5e9319e25f347c
    type: press
  mode: single

Your entity ID is missing its domain, i.e. sensor.dishwasher_delayed_option.

Again, you need to clarify what you mean here… “HH:MM” is not an integer, it’s a time string format. If your entity’s state returns a time string, your action should be fine once you fix the issue noted above.

Add action - other actions - perform action
will get you there in the ui.
I don’t know why they buttied it, it is the most important set of actions there.

image

I don’t think its a time string format. It works if i put plain text as “10:00”. Its just a select option like red, green, blue. but with the options 00:00, 00:30 etc. However it does not work with the sensor variable, i have corrected the domain. Will have a look at the sensor later.

Thanks - I actually also found it under “select->select”.

Thanks to @Didgeridrew and @Sir_Goodenough
I got it working. I learnt a lot about the automation UI and a bit more into YAML but still a novice.
Also the Home Connect Alt needs a program to be selected after the delay before the start action is executed. I will add some logic to this part because if the same program is selected as the one allready set on the dishwaser the delay will not trigger and the dishwasher will start instantly.

Here is how the code is now. sensor.dishwasher_start_delay_option is just plain text looking like a timestamp as the options is made this way.

actions:
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: button
    entity_id: 847ec15803cd65efdbdbd98205aee285
    type: press
  - action: select.select_option
    metadata: {}
    data:
      option: '{{ states(''sensor.dishwasher_start_delay_option'') }}'
    target:
      entity_id: select.gaggenau_df270160f_68a40e0c737b_bsh_common_option_startinrelative
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: select
    entity_id: 7f5ab0da8ca0e01020a717be731513bf
    type: select_option
    option: Dishcare.Dishwasher.Program.Auto3
  - device_id: b12c69c35cee6f3d260ca600a358ae0e
    domain: button
    entity_id: 5d58f8235aa1ab80eb5e9319e25f347c
    type: press
  mode: single