Input_select as input for Input_number

I’m referring this thread and trying to do something similar but in reverse but that thread is pretty old some maybe there is a better way?

I want to have a drop down list for my weber iGrill meat presets thus:

input_select:
  igrill_meat_selection:
    icon: mdi:login
    name: Select Meat
      - Select
      - Beef Medium (55)
      - Beef Rare (50)
      - Chicken Whole (74)
      - Chicken Pieces (74)
      - Lamb Medium Rare (55)
      - Lamp Rare (50)
      - Pork (71)

When an item is selected, it then transposes a hard coded value into the following using set_value:

input_number:
  igrill_probe_1_target:
    name: Probe 1 Target Temp
    #initial: 74
    min: 40
    max: 85
    step: 1

How easy is that to do?

you mean, upon selecting igril_meat_selection, you want the number igrill_probe_1_target to be set automatically to the corresponding temp?

that would be easily done using a mapper wouldn’t it, something like below?

  - alias: Set grill temp
    id: Set Grill temp
    trigger:
      platform: state
      entity_id: input_select.igrill_meat_selection
    condition: []
    action:
      service: input_number.set_value
      data:
        entity_id: input_number.igrill_probe_1_target
        value: >
          {% set temps =
             { 'Beef Medium':'55',
               'Beef Rare':'50',
               'Chicken Whole':'74',
               'Chicken Pieces':'74',
               'Lamb Medium Rare':'55',
               'Lamb Rare':'50',
               'Pork':'71'} %}
           {% set state = states('input_select.igrill_meat_selection') %}
           {{temps[state] if state in temps else '0'}}

note If added a 0 setting if the input_select wouldn’t be known or set properly. You could also set that as a condition of course:

    condition:
      condition: template
      value_template: >
        {{states('input_select.igrill_meat_selection') in 
             ['Beef Medium','Beef Rare','Chicken Whole','Chicken Pieces','Lamb Medium Rare',
              'Lamb Rare','Pork'}}
1 Like

That’s frick’n awesome, works a real treat and a whole lot simplier than the path I was trying to take. Thank you so much.

1 Like

cool. If it works to your liking, please mark the post as solved, so others can find the solution immediately?

happy grilling (though as a vegetarian I would have liked a ‘Bell pepper/Onion’ option :wink: )

Thanks. Oddly, I don’t see the option box for ‘solved’ on your reply.