tom_l
September 22, 2024, 12:04am
1
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:
Something like this: https://github.com/faeibson/lovelace-multiline-text-input-card
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.
Mikefila
(Mike Fila)
September 22, 2024, 12:28am
2
Return it’s state in a markdown card
tom_l
September 22, 2024, 12:29am
3
Sorry If I wasn’t clear, I need to be able to edit it from the card.
Mikefila
(Mike Fila)
September 22, 2024, 1:06am
4
I knew I was missing something. 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.
tom_l
September 22, 2024, 1:18am
5
That’s an excellent idea. Thanks.
They are script “fields”. See https://www.home-assistant.io/integrations/script/#fields
Mikefila
(Mike Fila)
September 22, 2024, 1:44am
6
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
tom_l
September 22, 2024, 1:45am
7
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:
tom_l
September 22, 2024, 1:53am
9
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
tom_l
September 22, 2024, 11:36pm
11
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:
and got this:
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
tom_l
September 30, 2024, 10:44pm
14
No worries. Thanks for trying.
It could be a very useful control. Bad we do not have it supported in HA.
tom_l
October 6, 2024, 11:42pm
17
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
tom_l
October 7, 2024, 12:02am
19
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;
Edit for the keen eyed you may have spotted an issue:
opened 12:08AM - 07 Oct 24 UTC
![Screenshot 2024-10-07 at 11-04-34 Administration – Home Assistant](https://git… hub.com/user-attachments/assets/cee60595-2d5d-4aae-bba5-c98dbaa70427)
```
type: custom:lovelace-multiline-text-input-card
autosave: false
entity: input_text.ignore_list
max_length: 255
min_length: 0
show_success_messages: true
title: Ignore List
buttons:
clear: 1
paste: 2
save: true
```
With this configuration I can not exceed 100 characters.