We have adopted a smart home design methodology based around 'technology abstraction'. This means that all user interfaces, software and hardware reference the devices and their state in a simple, human readable form. All inter-process messaging is also done this way. Put simply, we are speaking the same language as our smart home. This is also true for all of the models used to store state and context.
It means that there is no technology specific methods required to query and control sensors and devices, including their attributes and characteristics. It means that nothing in our smart home is tied to a specific vendor or supplier. Older or obsolete technologies easily can be replaced with new ones, without having to change the configuration.
The physical connection of sensors and devices is separate to their logical definition. This means that sensors and devices can be added, tested and simulated before being physically connected. This allows them to be optimised in terms of user experience, performance and reliability.
Technology abstraction means that it is also very easy to query and control things in the contextual smart home because the models it is using for values, state and context are also using the same language. So you can ask the contextual smart home questions like: "Which lights are on upstairs?" and it will know what you are talking about and be able to answer the question.