I’m using the input_text to set up a door lock using a custom publish via MQTT
looking for two things and could not find anything online that worked on my setup.
A way to limit the number of characters and only allow numbers in the input text (it’s possible to setup a maximum number of digits in the input_text, but it allows the user to type whatever it wants, and will not update the entity, I was looking for a way to limit the input in the input procedure)
a way to generate a random password with 6 digits (only numbers)
Can’t be done. Putting a regex validator on an input_text helper only does one thing, and that is to highlight the field in red (in the UI/on the dashboard) if the regex does not match. It will not prevent any value from being stored/submitted.
The only way I can see to prevent disallowed values would be an automation with a state trigger bound to your input_text. If a disallowed value is entered, immediately switch it back to the previous hopefully known good value.
I didn’t need to do anything special. What is your regex and from where are you editing the contents of the text_input? It may not be visible on say all kinds of dashboard cards. But if you edit the value directly from the helper info page, the one you get if you go into Settings > Devices & services > Helpers > your text_input it should work. Or at least it does for me.