Opening or closing a blind

Hi,

I struggle to find the best way to open or close a blind. I thought a Thing with a PushedProperty could work, but the schema doesn’t allow an action. I understand we can’t control such a Thing from the gateway.

Ideally, I need 2 “buttons” for a single Thing (a blind): One for opening the blind, the other one for closing the blind. They should be mutually exclusive in the UI, but that’s a bonus ;-). In an ideal world, the “button” will be pressed and immediately return to its previous state. A long pressed event support would be awesome (hence the PushedProperty).

Any idea how I could do that?

Thanks!

Sounds like you want an Action rather than a Property.
You are not limited to the the types in the schema.
You can simply create an action without a capability.
It will be represented as a button in the ui.

1 Like

I agree, opening and closing a blind is an ideal use case for an action. 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…

There is discussion on a shutter/blind schema here.

However, as @t1m1 says, you don’t have to follow an existing schema or wait for one to be defined, you can add as many properties, actions and events as you like and the gateway will render unknown actions as buttons.

1 Like

How can I have an action that presents a single button. I see in the standard the input type can be null, or boolean, but the former is displayed as an HTML <input />, and the later as a checkbox. How could it be just a single button that can be pressed?

Thanks for your answers!

You would just completely omit the input object.

1 Like

Thanks, it works perfectly :-).