Is there a better way to get user input for numbers?

Hey guys

So I recently found out there’s some api I can access to find the cheapest fuel stations given a postcode, which I’ve got working, but I want to make it a bit better by having a text input on my dashboard to let users choose the postcode they’re in, in case we’re out and about. This way we could say where we are and HA will tell us where the cheapest and closest fuel station is.

I currently have an input_number for the postcode, but when I add it to my dashboard, the default card for input number looks terrible, since it’s just showing the more info section for an input number, which doesn’t look great and isn’t very user friendly. The first part of my question is if anyone knows of a better way to get user input from the dashboard while looking good? Ideally like a text field they can just click and type directly in the dashboard without having to open up extra menus and whatnot?

The second part of my question is a bit more out there, but I have a list of suburbs and their postcodes - is there a way to autocomplete the input field based on what the user is typing? So if they start typing a suburb name it shows the available suburb names (and their postcodes), but if they start typing a postcode, it shows the available postcodes and thus the available suburbs? If so, a user could choose to type their postcode or suburb no matter where they are and find the cheapest fuel around, which would be pretty awesome!

Thanks in advanced, and hopefully that made sense!


You can use an input_text instead of an input_number.
The property pattern is here to help your input.

I don’t know the postcode format where you live but you can find someone who did a regex to validate those, I’m sure.

But you can also investigate to analyze/decode the geocoding of your location sent by your phone (if it is integrated in HA).

Thanks for the suggestion, I didn’t think of using text instead of a number. So here the postcodes we have are just 4 digits long. The input text is definitely better than the input number, but I was hoping for something cleaner like a native mushroom card input for example?

Also the location from my phone is a good idea, but it won’t work for all of my users unfortunately :frowning: