Why do I have to use states() and not state() for accessing the state of passed variable to a script: input numer

Hi, I got my script working, but I would like to understand why I need to use the states() function (and not just 'state() ) in my template condition to make it work. the passed variable is the entity name of a input number (helper entity).

google or chat-gpt could not provide me with a correct or understandable answer.

Thank you for clearing this out for me!

Fourth bullet point here:

I agree it’s a bit odd that it’s called states() when it returns a single state; but that’s the way it is.

The short answer is that the function’s name is states not state.

I don’t really know enough to be certain, but I think the template function/filter was named states() to avoid conflict/confusion with a backend state() function used to set state properties.

thank you for clearing this out!