Use multiple input selects to trigger multiple input numbers

Hi all, hopefully someone is able to help me out here.

I have setup a few BBQ temperature sensors to receive notifications when the grill or the product is at the right temp. and yes I know BBQ’ing should something that you have to work on yourself but just call me functionally lazy :slight_smile: the case is as following

I have 1 input_select to select a preset(eg. pulled pork, spareribs etc.)
I have another input select where you can select a temp probe (eg. probe 2, probe 3, probe 4)
I have an input_number to set te temp of the grill (which is probe 1) which sets the target temp for the grill
I have an input_number for every other probe(2, 3 & 4) that sets the target temp for each probe.

the idea is to select a preset(eg. Pulled Pork) and select a Probe and it should automatically set the target temp for the grill and set the target temp of each probe ( individually)

If I create an automation it will be intense long as for every new preset I have to setup an automation fot all 4 probes.

therefor i though of templating but the catch is, i have no idea to set this up with multiple in_selects to output to input numbers.

anyone any idea ?

thanks in advance!

Before any one starts spitting out template code: I would first suggest to use an input_select for each probe separately. Otherwise it will be really hard to set the probes for different presets, because two parameters are needed to set one probe.

Let’s suppose the number is set to 2, and you want to set probe 2 to pork. Will the temp setting change when you pick pork, or when you set the number? Because if you need to set the number, you’d need to switch the probe number to anything else then 2 before you can set it back to 2. But then you destroyed the other probe setting. If you set the temperature when you pick pork, then how would you go about to set probe 3 to something other than pork? Would you first need to change the number (setting that to pork) or could you pick the meat first?

It can be done, but it would make the UI very complicated, and in the end you wouldn’t know what each probe is set to anymore.

Hi Edwin, thank you very replying so fast!

You are absolutely right I just came to that conclusion as well, while I was struggling with it. Does that mean i have to setup a preset(eg. pork) for each probe as well?

to give you an idea, here is a print screen:

I hope this helps

Yes, that would be way easier and you could immediately see what probe is set to what type of meat. One control per probe, one target temperature for that probe. Pick the meat, see the proposed temperature for the probe.

Keep thing simple . Just use the input_select and input_numbers as variables . Don’t link them to any automation. Then create a button to start your automation and read the values from the input select and input numbers and apply the logic that way

When the automation completes zero out the input selects and input numbers

That also means that there is no need for a input_select for a probe? as i set the preset for each probe individually, so this can easily be a entity?

Make an automation that holds the configuration for each grill preset.

alias: Grill Setter
trigger:
- platform: state
  entity_id: input_select.grill_preset
variables:
  presets:
    'Pulled Pork':
      - input_number: input_number.probe1
        temperature: 74
      - input_number: input_number.probe2
        temperature: 74
      - input_number: input_number.probe3
        temperature: 74
    'Spareribs':
      - input_number: input_number.probe1
        temperature: 74
      - input_number: input_number.probe2
        temperature: 74
      - input_number: input_number.probe3
        temperature: 74
  turn_on: >
    {{ trigger.to_state is defined trigger.to_state.state in presets.keys() }}
condition:
- condition: template
  value_template: "{{ turn_on }}"
action:
- repeat:
    for_each: "{{ presets.get(trigger.to_state.state) }}"
    sequence:
    - service: input_number.set_value
      target:
        entity_id: "{{ repeat.item.input_number }}"
      data:
        value: "{{ repeat.item.temperature }}"

Then just make an input select with the name input_select.grill_preset
Then whenever you want to add values to the presets, just follow the yaml above.

I would use an input_select per probe 2, 3 and 4 and a target temperature per probe.

First of all, this is my first question here and am blown away by your quick replies and help. thank you!
I guess the combination is a bit of the above.
I would like to select probe (2,3or 4) and select a preset.
if this is done, all the input_numbers should change to predefined temperatures.

also, the ability to manuallu set the right temperatures with the input-numbers should be possible.

my apologies for (perhaps) over-asking.

It makes sense whats yopu are saying Edwin. I’ll dive into it.

1 Like

I got the impression that you’d have a single preset and all probes would be set to a target temperature.

I see what you did and its a great idea as well! one question, how will I be able to set different grill presets to different probes. for example. what would it look like if probe 1 has spareribs and probe 2 has pulled pork?

So you’d be cooking both at the same time?

yes indeed, whereas the different probe target temperatures could differ

That makes it complicated. There’s a number of ways to approach that. Id go with 2 input_selects. 1 for preset, 1 for probe, and a script:

script:
  alias: Set BBQ Probe Temp
  description: Sets the BBQ Probe Temp
  variables:
    preset:
      "Pulled Pork":
        "Probe 2": 74
        "Probe 3": 74
        "Probe 4": 74
      "Spareribs":
        "Probe 2": 74
        "Probe 3": 74
        "Probe 4": 74
    current_probe: "{{ states('input_select.bbq_probe') }}"
    current_preset: "{{ states('input_select.bbq_temp_presets') }}"
    current_temperature: >
      {{ presets.get(current_preset, {}).get(current_probe) }}
    current_input_number: >
      {{ states.input_number | selectattr('name', 'eq', current_probe) | first | default(none) }}
    continue: "{{ current_temperature is not none and current_input_number is not none }}
  sequence:
  - condition: template
    value_template: "{{ continue }}"
  - service: input_number.set_value
    target:
      entity_id: "{{ current_input_number }}"
    data:
      value: "{{ current_temperature }}"

Then just add the script bellow your 2 input_selects

every probe can have a different target temp(it measures the core temp of a product). products can have different core temps.
only the grill temp is set to only one temp.
for example. if i want to cook spare ribs and pulled pork. the grill temp should be betweet 100 - 120 degrees celcius. but the target temp for pulled pork should be 70 degrees and spare ribs between 85 and 95 degrees. I would like to receive notifications when the grill has the right temp(so I can put the meat on the grill) but also a notification when the target temps per product are set.

I hope this clearifies my use-case a bit more?

alright, this is what I got so far for a setup.


there are 4 probes in a row. once I select a preset for one of the probes, the right temp should be set in the bottom table with input_numbers and also the right grill temp.

The Automation I have at the moment is working but seems way too amature :slight_smile:
this is my automation for one of the probes(probe 3):

alias: BBQ Probe 3
description: ''
trigger:
  - platform: state
    entity_id:
      - input_select.bbq_temp_presets_probe_3
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_select.bbq_temp_presets_probe_3
            state: Spareribs
        sequence:
          - service: input_number.set_value
            data:
              value: 100
            target:
              entity_id: input_number.grill_alert_low
          - service: input_number.set_value
            data:
              value: 120
            target:
              entity_id: input_number.grill_alert_high
          - service: input_number.set_value
            data:
              value: 90
            target:
              entity_id: input_number.grill_probe_3_target
      - conditions:
          - condition: state
            entity_id: input_select.bbq_temp_presets_probe_3
            state: Hamburgers
        sequence:
          - service: input_number.set_value
            data:
              value: 195
            target:
              entity_id: input_number.grill_alert_low
          - service: input_number.set_value
            data:
              value: 205
            target:
              entity_id: input_number.grill_alert_high
          - service: input_number.set_value
            data:
              value: 70
            target:
              entity_id: input_number.grill_probe_3_target
      - conditions:
          - condition: state
            entity_id: input_select.bbq_temp_presets_probe_3
            state: Pizza
        sequence:
          - service: input_number.set_value
            data:
              value: 300
            target:
              entity_id: input_number.grill_alert_low
          - service: input_number.set_value
            data:
              value: 300
            target:
              entity_id: input_number.grill_alert_high
          - service: input_number.set_value
            data:
              value: 300
            target:
              entity_id: input_number.grill_probe_3_target
    default: []
mode: restart