The setting of the input_number needs to be done with a service call. And if you place the sensors in an array you can sort them with the sort filter. For the value of the lowest input_number's would be
{% set nums = [states('input_number.t1')|float] %}
{% set nums = nums + [states('input_number.t2')|float] %}
{% set nums = nums + [states('input_number.t3')|float] %}
{{ (nums|sort)[0] }}
@septillion I left the service call part out as I thought that would be understood.
As far as your recommendation… I need to map the sorted mqtt sensors to the input_numbers.
Like this…
“DS18B20-1”:“Temperature”:82.6 would set input_num.t3 = 1
“DS18B20-2”:"Temperature”:76.4 would set input_num.t1 = 2
“DS18B20-3”:"Temperature”:80.9 would set input_num.t2 = 3
Notice how the input_num equals the index of the temp sensor…
input_num.t3 = 1 which maps to the temp sensor DS18B20-1 ( hightest temp )
input_num.t1 = 2 which maps to the temp sensor DS18B20-2 ( lowest temp )
input_num.t2 = 3 which maps to the temp sensor DS18B20-3 ( middle temp )
@septillion
Something like this. Use the index to set the input_number. Question is how? I suspect it can’t be done in an automation ( or can it? ), so with a python_script?
{% set t1 = 83 %}
{% set t2 = 76 %}
{% set t3 = 81 %}
{% set temps = [t1,t2,t3] %}
{% set temps_sorted = temps | sort %}
temps: {{ temps }}
temps_sorted: {{ temps_sorted }}
{% for temp in temps_sorted %}
{{ temps.index(temp) }}
{% endfor %}
Now you simply need to make an automation in which you do three input_number.set calls. You will not be able to do so in a single call.
Alternatively, you could do all this in three template sensors (or a single one with a list). But you would have to break this again when you want to use it to select a sensor.
Or as alternative to the alternative, switch to an input_text to store a list.