Maximum length/size/limit for a HA text sensor in esphome?

Hey everyone,
while playing around with pulling weather data from HA into esphome I ran into an issue with data being cut off. Initially I suspected that the data just reached the limit of what can go into a HA text sensor, but in my specific usecase it turned out to be an issue with the further processing in esphome (details can be found in How to "clone" a weather entity into a template sensor, with less datafields? - #6 by Lakini).

The overall question remains: is there a limit for what I can pull into esphome from HA via a text sensor? If so: what is the limit? I found a few links here and there that mentioned 255 characters as the limit, but in my case I’m already way beyond that, so the 255 must be wrong.

What’s the actual limit?

Thanks a lot in advance!

May I ask if you figured it out?

Nope, never got around to digging deeper into it. But also since the initial issue never again ran into a situation where it played a role. Do you have a specific problem with it at the moment?

I don’t know but my guess is that there is no practical limit.

I suspect just the logs get cut off.

I think I recall increasing the logger messages once when trying to capture some long rf codes. Maybe it was logger: tx_buffer_size

https://cplusplus.com/reference/string/string/max_size/

https://esphome.io/api/text__sensor_2text__sensor_8cpp_source

1 Like

No, not yet at least.
I want to build a calender / agenda to be displayed on my ESP. I’m now at the question on how to transfer the data from HA to the ESP so I can show it easily. My idea is to build a string which lists all calender events - send it to the esp - split it there and display it. However for that I would end up with a long string I assume.