Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutter/blind capability schema #27

Open
mrstegeman opened this issue May 11, 2018 · 7 comments
Open

Shutter/blind capability schema #27

mrstegeman opened this issue May 11, 2018 · 7 comments
Labels
capability A request to create a new device capability

Comments

@mrstegeman
Copy link
Contributor

mrstegeman commented May 11, 2018

(Originally from WebThingsIO/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:

  • position % (mandatory)
  • slat angle % (optional)

and the actions:

  • UP, (optional)
  • DOWN, (optional)
  • STOP, (optional)
  • STEP_UP, (optional)
  • STEP_DOWN (optional)

As events :

  • bottom reached (optional)
  • top reached (optional)

What do you think ?

@benfrancis
Copy link
Member

@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.

@mrstegeman mrstegeman transferred this issue from WebThingsIO/api Dec 14, 2018
@benfrancis benfrancis added the capability A request to create a new device capability label Apr 29, 2019
@benfrancis benfrancis changed the title Standardization and native support for shutter/blinds devices Shutter/blind capability schema Sep 24, 2019
@benfrancis
Copy link
Member

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 (#11) and thermostats (#13) for example.

@ncalexan
Copy link

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
Copy link
Contributor Author

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
Copy link
Contributor

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

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

@Rudower
Copy link

Rudower commented Nov 1, 2020

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
capability A request to create a new device capability
Projects
None yet
Development

No branches or pull requests

5 participants