Hi!
I was using OpenHab for some time now but don’t like Java and wanted to switch to something more RAD-like to add custom functionality. Python seems to fit very well into that picture. That’s how I got to Home Assistant, where I currently play around and try to understand the architecture.
The developer documentation is pretty good, but I still don’t get the Component / Entity approach and how to use it for more complex scenarios.
In OpenHab, there is a strict separation between representation of (mostly) hardware elements (Things
) and typed interaction elements (Items
). A Thing could for example be a smart fish tank controller that allows to add Things of type Switch
(r/w) for the light control and Number:temperature
(r/o) for the actual measured temperature. Items
can be (re-)connected to different Things
- if my fish tank controller broke, I could just reconfigure the Fish Light Living Room - Item
to point to a smart power plug.
How would that scenario look like in Home Assistant?
As far as I understand you provided different base classes for Entity Components
like Switch
, Binary Sensor
, Light
etc.
If I wanted to create a Component
for the smart fish tank, that has different sensors and switches (temperature, light control, auto-feeder control) - or maybe even my smart power plug that is as well a temperature sensor - how would that fit into the picture? It’s neither one of those existing Entities, more of a hybrid kind. How would it look like both, from a developer’s perspective and from the configuration one later on?
Additionaly, consider my previous example. If I was using Automation
to script the behavior of the fish tank’s light switch, and the hardware broke and would be replaced by a smart plug. Could I easily modify the target, so the automation would still work?
Thanks in advance!