REST API - message with more than 255 characters

I know that the input_text helper can be used to send texts up to 255 characters via the REST API.

http://homeassistant.local:8123/api/states/input_text.my_message

I am looking for a solution to send a longer text (or even better a JSON element).

Use an attribute. They can be longer than 255 characters.

1 Like

Thx. The REST docs don’t tell how to access attributes, though.

Just observed they come along with the states.

How can I add a custom attribute?

It’s possible this way, albeit a little odd.

I ended up with an input_button. The state is used as a trigger. The custom attribute message is used to ship the message.

This is how the REST API looks alike.

This is the cool part. You can freely inject YAML → JSON into the attributes.

Screenshot 2023-01-08 at 15.19.17