homieiot / convention

🏡 The Homie Convention: a lightweight MQTT convention for the IoT
https://homieiot.github.io/
Other
710 stars 59 forks source link

Node type specification #152

Closed Thalhammer closed 4 years ago

Thalhammer commented 5 years ago

I propose adding a set of predefined node types with required properties to improve the handling of devices by controllers.

We already have a required topic $type for each node, I think it would be a really good idea to define a set of types which require, but are not limited to certain properties. An example is given:

A "lamp" should have at least the following properties:

A "dimmable-lamp" should at least have:

davidgraeff commented 5 years ago

See #38 and the linked PR and so on. I had proposed to have this as extension but at that time there was no extension mechanism in place.

Thalhammer commented 5 years ago

Would this really be an extension? The $type topic is already in place in the base convention. I think we would only need to specify its values.

davidgraeff commented 5 years ago

It is about the values :)

mjcumming commented 5 years ago

Has any work been done on specifying a core set of device/node/property types?

mjcumming commented 4 years ago

Would it be better to have a device $type topic rather than a node $type?

Thalhammer commented 4 years ago

@mjcumming I think there is a good argument for both. Lets take the car example used in the convention. Devicetype would be car and you have a couple of nodes with different types like light or engine. Nodetype would probably be more important but I think both have there reason to exist. But if we allow both we should probably make separate registries/lists for both as I don't think there is a lot of overlap between them.

mjcumming commented 4 years ago

Probably we should come up with some use cases to try and vet out the best approach. My thoughts are that any further development along these lines is to allow controllers to have a functional understanding of Homie devices.

Arguably, we need to start with properties and define additional properties (or behavior of existing). Ie. the OpenHAB implementation uses a Boolean for representing a switch or contact. That is fine but it should be defined somewhere. I use OpenHAB as an example and my guess is it is the most use controller for Homie devices.

I am not a big fan of the use of the car example. Its just not a home automation use case. I also don't really see the purpose of Nodes. Its nice on paper as a way to structure devices but in any of the 100 Homie devices I have connected to OpenHAB, the Node has no real functionality. I don't see where a controller needs to know anything about Nodes. But since we have Nodes I am not suggesting we change or remove that. But I (from my use) don't understand their purpose.

mjcumming commented 4 years ago

My mistake on hitting close....

mjcumming commented 4 years ago

I am going to close this so we can keep all discussion in this thread.

https://github.com/homieiot/convention/issues/205