I do not care about recreating anything from NEEO. For NEEO smarthome was a side issue. However, I’ve been inspired by some interfaces (Alexa SmartSkill, Samsung SmartThings, Open Connectivity Foundation, openHab) and the way they are implementing it. I do not like the fact that integration-specific functionalities appear in different parts (integration, components) in the current YIO Remote implementation. And currently you have to search in the sources to find
I think it is better to define one standard object for each of the various things that you want to support (light, awnings, climate, temperature, speakers …) and on which the GUI then operates. And each of this thing typically supports several functionalities ( = features)
Light : Switch, brightness, color, color temp
Speaker : Vol up, vol down, vol level
In my implementation LightEntity has this properties (some more comments should be added)
property string entity_id
property string area
property var friendly_name
property bool sup_switch
property bool sup_brightness
property bool sup_color
property bool sup_colortemp
property bool state // on / off
property int brightness // 0 .. 100
property int color // rgb
property int colortemp
property bool favorite
The features are the sup_xxxx.
And depending oin the features LightEntity supports the commands.
“TOGGLE”, “ON”, “OFF”, “BRIGTHNESS”, “COLOR”, “COLORTEMP”
The implementer of an integration “only” has to convert the integration specific representation into the
“standard” object properties and to understand the “standard” commands. Sometimes the features have to be configured sometimes they are delivered by the integration hub.
I know the original implementation in components/light/homeassitant.qml has the same functionality. But the standard object LightEntity has the advantage that it also documents what the GUI supports and what the hub implementer has to implement.
Converting hub specific data into the standard object should be part of the one and only integration component. When the system grows (more objects, more integrations) I think it is better to have a clear structure (divide et impera). In the current state of the project (only light and homeassistant) it looks maybe over - engineered but I think this is the right moment to introduce a scalable structure which helps to handle complexity when the system is growing.
The generic “Entity” object which I use as generalization of all kind of objects is maybe not necessary but in my opinion simplifies hub implementation and config.json read write.
The bitmap feature_map maybe should be replaced by a string array of features. But this is only an implementation detail.