homieiot / convention

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

drop the `node.$type` field #236

Closed Tieske closed 1 year ago

Tieske commented 1 year ago

The node.$type field is just a free format string value. It carries no information wrt the convention itself. This essentially means it is a read-only property value. And hence it should be modeled as such.

So instead of this;

homie/super-car/engine/$name → "Car engine"
homie/super-car/engine/$type → "V8"
homie/super-car/engine/$properties → "temperature"

homie/super-car/engine/temperature/$name → "Engine temperature"
homie/super-car/engine/temperature/$settable → "false"
homie/super-car/engine/temperature/$unit → "°C"
homie/super-car/engine/temperature/$datatype → "float"
homie/super-car/engine/temperature/$format → "-20:120"
homie/super-car/engine/temperature → "21.5"

it would be;

homie/super-car/engine/$name → "Car engine"
homie/super-car/engine/$type → "V8"
homie/super-car/engine/$properties → "temperature,type"

homie/super-car/engine/type/$name → "Engine type"
homie/super-car/engine/type/$settable → "false"
homie/super-car/engine/type/$datatype → "string"
homie/super-car/engine/type → "V8"

homie/super-car/engine/temperature/$name → "Engine temperature"
homie/super-car/engine/temperature/$settable → "false"
homie/super-car/engine/temperature/$unit → "°C"
homie/super-car/engine/temperature/$datatype → "float"
homie/super-car/engine/temperature/$format → "-20:120"
homie/super-car/engine/temperature → "21.5"