Text input from UI to attribute, more than 255 characters

Hey everybody,
I am looking for a way to create a text input field on the Dashboard which saves the input made through the UI to an attribute of a sensor. It must be an attribute since I need more than 255 characters so input_text does not work for me.

The multiline text input card is almost perfect, except there does not seem to be a way to save thin inputted text to an attribute, only an input_text.
Anybody got an idea?

Thanks!

You’d probably have to fork that card and change it to allow for a service call. Then from there figure out how to get the information into an attribute.

Is there a reason why you need 255 characters? What’s the end goal here?

Hi, thanks for your response, the scenario is the following:
We have a concert venue where all the light, PA systems, guest counter, heating, etc. is controlled via home assistant. At the end of each night an automated e-mail goes out to the staff with the most important facts from home assistant (opening/closing time, number of visitors, weather, etc.). At the moment the night manager of the venue has to write a second email in thunderbird with a text describing everything that happend that night (something broke, somebody from the staff fell sick, how did the artists perform, etc.).
I would like to bundle that into one email, so in the HA Dashboard is a text-input-field where the night manager can write notes during the evening and this is then incorporated in the automated email at the end of the night.
These notes of course often have more than 255 characters, and just adding a lot of input_text fields is not a very elegant solution in my eyes…

I hope you can follow my explanation :sweat_smile:
If you have another idea not involving text sensors I am absolutely open to that of course as well!

looking for exactly the same thing - have you found a way to do this?

I believe this is where the entity value gets written:

		callService(service) {
			if(this.state.entity_type === 'input_text' || this.state.entity_type === 'var') {
				let value = (typeof this.state.service_values[service] === 'function' ? this.state.service_values[service]() : this.state.service_values[service]);
				if(this.state.service[service]) {
					let _this = this;
					this._hass.callService(this.state.entity_type, this.state.service[service], {entity_id: this.stateObj.entity_id, value: value}).then(function(response) { _this.displayMessage(service, true) }, function(error) { _this.displayMessage(service, false) });
				}
			}
		}

I tried changing it to the following (add a full_text attribute), but with no luck:

		callService(service) {
			if (
				this.state.entity_type === "input_text" ||
				this.state.entity_type === "var"
			) {
				let value =
					typeof this.state.service_values[service] === "function"
						? this.state.service_values[service]()
						: this.state.service_values[service];
				if (this.state.service[service]) {
					let _this = this;
					this._hass
						.callService(this.state.entity_type, this.state.service[service], {
							entity_id: this.stateObj.entity_id,
							value: value,
##################################
This is the part that I added

							attributes: {
								full_text: value,
							},
##################################
						})
						.then(
							function (response) {
								_this.displayMessage(service, true);
							},
							function (error) {
								_this.displayMessage(service, false);
							}
						);
				}
			}
		}

Honestly not even sure that’s where I’d need to do this - I’d be very thankful for your inputs!

The previous guy never replied directly to me, so I never got a ping to respond. What are you trying to do? You can likely do this without modifying any code.

Basically I want the exact thing that the card offers, but I’d like to circumvent the 255 character limit.

In other situations I am circumventing that limit by adding a ‘full_text’ attribute to an entity. For example when scraping text passages from a website that are longer than 255 characters.

As the input_text is limited to 255 characters, my thought was that in this case I could also somehow get the text inside the multiline text input card written into the entity’s attribute rather than its value

@petro I replied to your message, but it doesn’t show that in my reply, so I’m not sure if you were notified about this :thinking:
Any pointers on how I could achieve the more than 255ch texts?