I’m not sure I follow your question. Can you explain it more please?
I want to call sensor.correct_hour with different source data from input_text, where is states.input_text.iframe.state I want to use different source data (iframe2, iframe3, …). But it is the simplest to do:
sensors:
correct_hour:
value_template: >
{% set my_hours = states.input_text.iframe.state.replace('[','').replace(']','').replace(' ','').split(',') %}
{{ strptime(states('sensor.time'), "%H:%M").hour | string in my_hours }}
correct_hour2:
value_template: >
{% set my_hours = states.input_text.iframe2.state.replace('[','').replace(']','').replace(' ','').split(',') %}
{{ strptime(states('sensor.time'), "%H:%M").hour | string in my_hours }}
Yeah, you won’t be able to make a single sensor that has more than 1 attribute without making a custom component. What you did is what I would have done.