homieiot / convention

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

switch/power datatype #159

Closed mjcumming closed 4 years ago

mjcumming commented 5 years ago

I see in one example using a power property as a Boolean to represent the state of and to control the state of a device say a light with true being on and false being off.

Is this the standard approach for a property with an on/off state?

I realized this after doing an implementation using enum with ON/OFF datatypes.

What is the best practice to implement a switch device in Homie?

Thalhammer commented 5 years ago

There is currently no convention regarding the actual properties of a node. However, it is marked as an issue to include common device profiles. See #152

kollokollo commented 4 years ago

Maybe one can extend the specification for a boolean property, accepting "ON" in addition to "TRUE" and "OFF" in addition for "FALSE". I usually have called the topics for an on/off switch: "device/light/ONOFF/set" Maybe also the combination ".../something/ONOFF/set" could be standardized.

mjcumming commented 4 years ago

Closing so we can discussion in one thread.

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