Any work arounds for input.text field character limit?

Hi Everyone,

I am using an input text to store podcast urls for media player casting.

Some urls hit the 255 character limit and I have to use a url shortner. Any ideas on how to work around this, I know its not a new limit?

The state value of all entities is limited to storing a 255 character string.

In contrast, attributes can store different types (string, int, float, boolean, list, etc) and have no limit.

One option is to publish the URLs as retained messages to an MQTT topic. Use an MQTT Sensor’s attributes to display the URLs.

1 Like

Thanks for the idea. I will give the MQTT topic a go if there are no other alternatives :slight_smile:

The only other alternative I can think of is to store the URLs in a file but this is messier than what I had suggested.

The limit on state value is a hard-limit that applies to all entities so you can forget about using it to store anything exceeding 256 characters. That leaves you with using attributes. So the remaining challenge is to store the URLs in an entity’s attributes. Depending on how much flexibility you need when assigning the URLs, you could use a Template Sensor or MQTT Sensor.

Thanks for your ideas. I might end up making an appdaemon script to do it.