Help with dynamic input select

Dear all,
i have the following scenario:

input select 1: hours from 10:00 to 15:00 (step 15min: 10:15…10:30…11:00)
input select 2: hours from 10:00 to 15:00 (step 15min: 10:15…10:30…11:00)

i’m trying to achieve this goal:

if i select 12:00 in input_select_1 then in input_select_2 automatically i have to show only hours bigger then the value selected in input_select_1 (ex from 12:15 to 15:00)

Thanks a lot!

If you want dynamic options, you need a Template Select for #2, not an Input Select.

There is an previous thread where I have posted a number of examples of Template Selects:

Thanks a lot man!
I’m going to study the topic!!!

Your options template could be:

{%- set input_1 = states('input_select.EXAMPLE') %}
{% set time_limit = today_at(input_1) %}
{%- set opt = state_attr(input_1, 'options') %}
{%- set ns = namespace(options=[]) %}
{%- for t in opt %}
  {%- set ns.options = ns.options + [t] if time_limit < today_at(t) else ns.options %}
{%- endfor %}
{{ ns.options }}
1 Like