Need to enter 500 character urls somewhere

Hi there,

my wife does home exercises via a web conferencing system and the urls are usually about 500 characters long. I wanted to have an input field in home-assistant where she puts the URL and then via shell-command (ssh [email protected] "export DISPLAY=:0.0 ; flatpak run org.mozilla.firefox \"{{ states("input_text.firefox_url") }}\" & disown") opens firefox on the multimedia PC with this url (after launching the PC, starting the TV, setting channels, etc.).

This works fine, but only for urls below 255 characters. Anything longer can not be entered into the text_input field in the frontend. Is there any way for me to let my wife put the url somewhere in home-assistant, where I then can launch my automation?

Hi @maweki

Did you check with a URL Shortener service like bit.ly? So you will have only a url of 22 characters to entered.

1 Like

If you can’t shorten them as @sicarriere suggests above you will have to create multiple input texts to store 1 url depending on length
so : -
{% set longurl = ‘abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz’ %}
{% set url01 = longurl [0:255] %}
{% set url02 = longurl [255:510] %}
{% set url03 = longurl [510:765] %} etc. as required
- service: input_text.set_value
data:
entity_id: input_text.url01
value: “url01” # note you will have to actually paste in the 0:255 value here
'# ditto with the rest
then reassemble where used
url: “{{ states(‘input_text.url01’)~states(‘input_text.url02’)~states(‘input_text.url03’) }}”

Play with it till it works

Also, although states are limited to 255 characters, attributes aren’t.

So you could either create custom a attribute for the text entity or use a variable custom integration and create the attribute and then enter the url in the attribute.