WebThingsIO / zigbee-adapter

Zigbee adapter add-on for WebThings Gateway
Mozilla Public License 2.0
46 stars 29 forks source link

Change name of "on/off" property to "power"? #192

Open flatsiedatsie opened 4 years ago

flatsiedatsie commented 4 years ago

The Tradfri lamp has an binary toggle to switch it on and off. Currently, this is called "on/off".

I was wondering if there would be a better name for this property. The reason is that this property is not optimal for use with voice commands.

Using Voco (and probably any future voice add-on), interactions look like this:

Q. "Turn on the corner lamp" A. "setting onoff of corner lamp to on".

Q. "What is the state of the corner lamp?" A. "onoff of corner lamp is off".

Similarly, a user that wants to know or set the specific value of this property would theoretically have to ask: "is the onoff of the corner lamp on or off" and "Set the onoff of the corner lamp to on". But those commands currently don't work, because a voice command wouldn't contain the slash in between on and off. Thus the string can't be reconstructed. As a result the command isn't just a tongue twister, it doesn't currently work.

One solution would be for Voco to recognise "on off" in a voice command and add the slash to the string before sending it over the API.

But I would like to instead suggest using a property name like "power" would be better suited to voice control. It would result in:

Q. "Is the power of the corner lamp on or off?" A. "power of corner lamp is off"

Q. "Turn on the power of the corner lamp" A. "setting power of corner lamp to on"