WebThingsIO / schemas

A Web of Things schema repository
https://webthings.io/schemas/
5 stars 8 forks source link

Shutter/blind capability schema #27

Open mrstegeman opened 6 years ago

mrstegeman commented 6 years ago

(Originally from mozilla-iot/gateway#995)

This more a feature request than an issue, but would be great to natively support and standardize the shutters and/or blinds devices. For a shutter we have the position and for the blinds we have in addition the slat angle in % (this could be in degres or radian too, but conversion would be easy)

Basically, the properties are:

and the actions:

As events :

What do you think ?

benfrancis commented 6 years ago

@jarod68 I think this a great idea.

In the next version of our Web of Things implementation I think we're going to move out all of the Web Thing Types into an external schema repository of "capabilities". We should probably hold off and create a schema for this in that repository.

benfrancis commented 4 years ago

From a discussion in Slack:

This is a good example of where an action should be used instead of/in addition to a property. From the Web Thing API specification:

'Actions are used when the setting of a property alone is not sufficient to affect a required change in state. This may be used to describe a function which takes a period of time to complete, manipulates multiple properties, or has a different outcome based on provided arguments or current state. An example might include a "fade" action which has a specified "duration", a "sequence" action which triggers a sequence of flashing lights or a "toggle" action on a switch.'

In the case of the blind, there's a chance that an HTTP PUT request on a simple numerical property from 0% to 100% may not complete before an HTTP timeout occurs. Properties are best used for physical attributes for which a change is relatively instant, so the change can be confirmed in the response to an HTTP request. Opening/closing a blind is a long-running action which could be requested and then later have its progress monitored or be cancelled, which are things you can do with an action.

Another way to model this would be separate properties for current state and desired state. This is the approach we're discussing for locks (https://github.com/mozilla-iot/schemas/issues/11) and thermostats (https://github.com/mozilla-iot/schemas/issues/13) for example.

ncalexan commented 4 years ago

First, I'm building a blind and I'd really like to see this added to the existing schema. (I don't know if it's possible, or how to, make Mozilla's Gateway handle things that aren't defined in the schema.)

My open questions are about modelling. This has a strong directionality -- UP/DOWN -- that might not age well. I wonder about OPEN/CLOSED or EXTENDED/RETRACTED, which would work for horizontal blinds, and might generalize to other types of motion (garage doors were suggested in other discussions). I noticed that there were "pass through schema definitions" that said that an underlying boolean corresponded to ON/OFF, so maybe what is wanted is something very specific and then layers of additional semantic interpretations? I'm new to this game!

mrstegeman commented 4 years ago

First, I'm building a blind and I'd really like to see this added to the existing schema. (I don't know if it's possible, or how to, make Mozilla's Gateway handle things that aren't defined in the schema.)

You don't have to include anything in the @type array, i.e. your device doesn't have to conform to an existing schema. A generic UI will be generated for you based on property titles and types.

My open questions are about modelling. This has a strong directionality -- UP/DOWN -- that might not age well. I wonder about OPEN/CLOSED or EXTENDED/RETRACTED, which would work for horizontal blinds, and might generalize to other types of motion (garage doors were suggested in other discussions). I noticed that there were "pass through schema definitions" that said that an underlying boolean corresponded to ON/OFF, so maybe what is wanted is something very specific and then layers of additional semantic interpretations? I'm new to this game!

This is why I suggested a LevelProperty. For instance, BrightnessProperty is just a specialized LevelProperty.

dhylands commented 4 years ago

For vertical blinds, Up/Down doesn't make sense.

I think that open/close could be applied to both position and slat angle.

Rudower commented 3 years ago

Hi all. I'm trying to discover through wifi my new blinds/shutters switch, but it doesn't appear when I click the things add button. I don't know what might be going wrong, or what else I must do to be able to command it from my gateway.

Any help or hint will be highly appreciated. Thanks beforehand.

benfrancis commented 3 years ago

Hi @Rudower,

Sorry but this issue is still open because we haven't defined a scehema for blinds/shutters yet.

You can find a list of currently supported hardware here and get support on the forums.