Input text box card?

Input text helpers are difficult to edit when there is a lot of text. The entities card only shows it as one line.

Is there an “input text box” type card anyone knows of?

So instead of:

Screenshot 2024-09-22 at 09-52-38 Administration – Home Assistant

Something like this: https://github.com/faeibson/lovelace-multiline-text-input-card

Screenshot 2024-09-22 at 10-02-43 Administration – Home Assistant

Though unfortunately that card has not been supported for 4 years and it maxes out at 100 characters even though the entity can support 255.

Return it’s state in a markdown card

Sorry If I wasn’t clear, I need to be able to edit it from the card.

I knew I was missing something. :sweat_smile: They added a feature for scripts that when opened you get a multi line input box. I can’t find where it’s documented though or if it can be populated with an entity state. It definitely expands and allows multi line input.

That’s an excellent idea. Thanks.

They are script “fields”. See https://www.home-assistant.io/integrations/script/#fields

I see, what I overlooked was the selectors link. That shows all the options for the input section.

https://www.home-assistant.io/docs/blueprint/selectors/#text-selector

Hmm. I don’t seem to be able to get it to work correctly. Tried with and without the default template:

# scripts.yaml

update_ignore_list:
  alias: Update Ignore List
  fields:
    ignore_list:
      name: Ignore List
      description: "Sensors to ignore"
      example: "sensor.one,sensor.two"
      default: "{{ states('input_text.ignore_list')}}"
      required: true
  sequence:
  - service: input_text.set_value
    target:
      entity_id: input_text.ignore_list
    data: 
      value: "{{ ignore_list}}"

All I get is an “action data” input, no named field, no default:

Ah I see thanks.

Damn. It does not support templates. Which makes it kind of useless:

update_ignore_list:
  alias: Update Ignore List
  fields:
    ignore_list:
      name: Ignore List
      description: "Sensors to ignore"
      example: "sensor.one,sensor.two"
      default: "{{ states('input_text.ignore_list')}}"
      required: true
      selector:
        text:
          multiline: true
  sequence:
  - service: input_text.set_value
    target:
      entity_id: input_text.ignore_list
    data: 
      value: "{{ ignore_list}}"

A possible (untested) solution - cardmodding input box: height, multiline

I just tried removing the default option in the hope that the entity current value would populate. It did not.

Will take a look in 10 days.

1 Like

Coming back with negative results.
A brute way was not successful:
injected some changes by Code Inspector:
image

and got this:
image

But the state of the helper is not processed (i.e. changed text in not saved inside a “state”) - probably an “input” object is required.

Info here.

1 Like

No worries. Thanks for trying.

It could be a very useful control. Bad we do not have it supported in HA.

Have not tested myself:

1 Like

Thanks. It works well but I can’t work out how to select the header for styling to match my other cards:

This isn’t it:

card_mod:
  style:
    $: |
      div#card-header {
        font-size: 20px !important;
        font-weight: 300 !important;
        letter-spacing: 0px !important;
        padding-top: 0px !important;
        padding-bottom: 28px !important;
      }

Have no access to PC. Will start testing the card in 9 days. Will come back with a feedback.

1 Like

Got it with trial and error:

card_mod:
  class: top-level-card
  style:
    .: >
      ha-card.background.type-custom-lovelace-multiline-text-input-card
      div.card-header {
        font-size: 20px !important;
        font-weight: 300 !important;
        letter-spacing: 0px !important;
        padding-top: 0px !important;
        padding-bottom: 28px !important;

Screenshot 2024-10-07 at 11-02-22 Administration – Home Assistant

Edit for the keen eyed you may have spotted an issue:

Styling multiline-text-input-card by card-mod (+fixing some glitches)