Storing list of floats in Sensor Value entry

I’m struggling to figure out how to read and store an unusual data type, which is a long list (512 or or more entries) which updates every 5 seconds or so. I was thinking of making a Template sensor to parse out the list over MQTT, but I see that the only data types supported are None , datetime.date , datetime.datetime , decimal.Decimal , float, int, string.

The data is coming from a Teensy computing the FFT of an accelerometer input. So all entries in the list really should be stored in the same object with the same timestamp in my opinion.

I suppose I could parse it out using a Template and have 512 sensors, but that doesn’t feel like a clean way to do this. Or perhaps there is a way to have a dictionary with 512 entries in the same sensor?

Ultimately I intend to graph this data in a histogram. I’m logging into InfluxDB, if that’s relevant.

What is the best way to consume and store this?

You can store complex data in an attribute on the sensor as JSON, and have the state as something simple - eg. a count of the items in the list.

1 Like