I’m trying to understand the overall architecture of the system. There is a lot of detailed documentation, but I haven’t found a good architectural guide.
For example, I have a number of Tasmota devices and can see them in entities but can’t see how to find more info like the IP addresses in the database or the entity API.
I also added a Lutron Pico switch and it shows up in the online interface but I can’t see it at all in the database or via the API.
I’m obviously missing something – so need a starting guide and then I can drill down on the details myself.
It’s definitely not in the database. The database is purely history. It contains a record of all the states entities and all the events that have been fired with a timestamp, that’s it. There is no configuration information in there at all. If you stopped HA, completely deleted it and started HA again nothing would break. You would simply wipe out everything in your history panel. That’s all its used for.
Not sure what you’re referring to here but entities don’t have an IP address. Entities are created to hold the state of a particular aspect of a device. An IP address could be a diagnostic aspect (looks like it is in your later screenshot). In which case the state of that entity would be its IP address. But the entity doesn’t know what it holds. There’s no metadata making an entity holding an IP address somehow special, its just a sensor.
Assuming this device is UI configured or automatically discovered what I think you might be looking for is the device registry. Whenever a device is added to HA by an integration its added to the registry along with any other pertinent config information HA needs to know to communicate with it. This data is held in an internal json file, not really intended to be directly interfaced with. You can find it within your config folder at .storage/core.device_registry if you want to take a look at it.
There is no published schema for this file however and its schema is subject to change without warning since it is only intended to be looked at and interpreted by HA and its integrations. Users are supposed to view device data in the UI.
As for an API, there is no device API. However you can get to device data in templates. And you can render a template and receive the result by calling POST /api/template. That’s really the closest you can get to a device API today.