Best way to manage hundreds of complex entities?

Hi,
I know Hass probably wasn’t designed with this in mind but thats the beauty of it :slight_smile:

I have a few hundred objects on a CNC grid, each object consists of the following attributes:
x
y
z
temperature
humidity
uniqueID

except for uniqueID, all the values are being constantly changed (either through call_service, MQTT or API), the catch is that I need to store the historical data for each of those attributes, and as far as I am aware, each entity can have only 1 state and Hass only stores history for states (so for example an mqtt sensor with extra ‘attributes’ wouldn’t solve this (unless there is someway to save historical data for attributes and not only states, and a custom component wont solve it either since they are also limited to 1 state right?)

My current, far from ideal idea is to create a custom mqtt sensor for each one of those attributes (5 ‘sensors’ per object, with the name of the sensor in format of ‘sensor.uniqueID_attributename’, this would mean creating 3,600 sensors in Hass)

Any creative ideas on how to get this done differently?

Any help would be appreciated,
thanks

What’s the end game here? You have 3600 sensors in Home Assistant … and then what? Is there a plan to create automations to do something with these 3600 sensors?

I’m not seeing the need for ‘home automation’ software. If the goal is to simply record the states of “a few hundred objects on a CNC grid” in order to graph them, then there are better tools for the job (such as Influxdb and Grafana). Home Assistant’s default sqlite database and its native History Chart are hardly the best tools for storing reams of historical data or creating detailed charts.

I think you’ll find the result to be the exact opposite of ‘beauty’.

3 Likes

I didn’t mention it, but yes there will be about 30 complex automations using node-red.
Hass provides basically all the infrastructure we need, including DB, frontend, automation, mqtt, API, esphome (as all of the sensors are connected to dev boards),
I don’t need to put those 3600 entities on the panel, I just need the data managed and automated, so i don’t care if it’s ugly behind the scenes.

Ideally I’d like to not create 5 ‘sensors’ for each object but I don’t see another way currently, that’s my only issue with Hass, so worst case I’ll bite the bullet

Thanks

Write a sensor component specific for your use case that breaks out the sensor so the 5 individual pieces are logged or whoever you need this

If you’re already using Node-Red, which offers connections to database, MQTT, and a UI, why add Home Assistant to the equation? Its strength is integrating a vast array of different devices to operate as a synergistic whole. Your application appears to be focused on one device, a CNC machine.

Whether its 720 or 720 x 5 sensors, the Lovelace UI will render them all in “Unused entities”. If nothing else, you’ll be stress-testing the system.

If I have not convinced you that Home Assistant is the wrong tool for this job then at least take this one bit of advice: don’t use a Raspberry Pi for this project.

1 Like