Where are the API docs about how to create sensor entities?

Here are the API docs, websockets:

However, there is no information about how to create entities (I’m interested in sensor entities). All that is documented is reading, but I suspect it is possible to create new entities, then why is it not documented there ?

It will also be valuable to document the properties of a sensor, or link to them, which seems to require a combination of:

and

Is this “connection” documented somwhere else?

You can create sensors out of thin air with the REST api

POSTing a state to a non-existing sensor will actually create it.

Not sure the same can be done with the websocket API, which was basically design for the UI, nothing more.

Does that allow me to set device class and unit of measurement?

Not directly, but

That kind of manual work is what I’m trying to avoid by creating entities through the API to begin with, so it is not a valid solution.

Why is the HA API so restricted? Isn’t this supposed to be an open platform ?

It’s so open that you can create an integration yourself to meet your requirements.

Being open doesn’t mean “doing anything anyhow”. As per the architecture, entities are to be created by integrations. The REST api “solution” is already somewhat an abuse.

Having a more capable API will help integrating more tools into the ecosystem.
With this “architecture limitations” only python code in HA extensions can be fully integrated into HA.
I wish the API was on par with what most integrations can do so I can build systems externally and then just integrate them with HA.

Feature requests go in Github, buddy.

There’s already a solution for that. Write your own custom integration.

We’re 7 posts in and you haven’t told us what sensors you’d like to integrate into HA.

You’re right. I tend to just release my frustration in any random place. I should open a feature request for that part.

The sensors that I want to integrate are a bunch of sensors that I’m reading from my solar inverter that I’m reading from Node-RED, and I want to integrate them into Home System in a way that they are part of the Energy Dashboard. If I’m not mistaken, for that I need to define the device class and the unit, and I’m not sure if I need to specify anything more. The thing is that they are a bunch of sensors, and I don’t want to create them manually. Updating them programmatically is a solved problem, but creating all of them is a different story.

What are the exact requirements for these entities to be considered into the Energy Dasboard?

The requirements are like you mentioned earlier - device class & unit of measurement.
If you have them integrated into HA somehow already, you should be able to simply use customize.yaml to add the missing attributes.

MQTT based sensors can manage these attrbiutes such as device, unit of measurement etc.

You need to have MQTT add-on and MQTT integration but the rest is easy

I have them already integrated and with the right device class and unit of measurement, and still they don’t appear in my energy dashboard.

Here you can see them listed:

However, in my energy dashboard, I only see all the values coming from the Modbus integration that I tried earlier (didn’t removed it yet):

You are pointing out to a different problem now, how to import into energy dashboard is different then how to define them. Is the initial problem solved now?

If yes, let’s move onto this: Integrating individual device energy usage - Home Assistant

Yes, the original problem is solved here: Send a bunch of data from node-red to home-assistant, what is the best way - #4 by danielo515