WebThingsIO / schemas

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

SceneControl capability schema #70

Open tim-hellhake opened 3 years ago

tim-hellhake commented 3 years ago

I wonder if we can make the PushButton writable so it can also be triggered by the gateway UI. This would be useful for the scene adapter for example.

mrstegeman commented 3 years ago

Do you mean not read-only?

mrstegeman commented 3 years ago

Similar discussion here: https://github.com/WebThingsIO/webthing-node/issues/135

tim-hellhake commented 3 years ago

Do you mean not read-only?

Yeah, small typo big difference :sweat_smile: Using another addon just to emulate a PushButton seems a bit heavy. But making the property writable doesn't feel right either. An action would be a much better fit. What do you think about a separate Scene capability with an Activate action?

mrstegeman commented 3 years ago

In terms of hardware, I suppose this would map best to remotes and such. What’s not clear to me is how the scenes are actually configured, or whether that should even be part of the schema.

tim-hellhake commented 3 years ago

Usually, the scene is configured in the vendor app. It would be nice if we could expose them to the gateway. The Activate action should be sufficient for that.

benfrancis commented 3 years ago

Capability schemas are meant to describe capabilities of physical devices and as I understand it SceneControl is not really a capability of a physical device.

What exactly are you trying to achieve with the scene adapter that you can't currently do? Perhaps this is a missing gateway feature rather than a capability schema.

mrstegeman commented 3 years ago

@benfrancis that's why I brought up a remote control, e.g. some of the IKEA Zigbee remotes. Those are physical devices. It just seems less than ideal to have a schema that can only activate a scene, rather than also configuring it.

tim-hellhake commented 3 years ago

What exactly are you trying to achieve with the scene adapter that you can't currently do?

Currently, you have to open the device every time you want to activate the scene. It would be far easier if you could simply activate the scene from the things view just like you can enable a light bulb. The same applies to scenes which are configured by the user in the vendor app.

Capability schemas are meant to describe capabilities of physical devices

I agree that it's not a physical device, but it aggregates physical devices.

Perhaps this is a missing gateway feature rather than a capability schema.

The capability schema is currently the only way to customize the things view from the adapter. If we implement the SceneControl only in the gateway, this would be enough.

benfrancis commented 3 years ago

The capability schema is currently the only way to customize the things view from the adapter.

Yeah I understand, and the Scene Control Adapter models scenes as virtual devices because that was the only option available.

But it sounds like you really want to fix a UI problem rather than an API problem? Unless you actually have a physical device with buttons on to select different scenes (which can probably just be modelled as PushButtons), scenes feel like software presets inside the gateway rather than affordances of a physical device.

See also https://github.com/WebThingsIO/gateway/issues/635

Another starting point could therefore be to build a scenes extension add-on which provides a better UI for managing scenes, which then calls the Web Thing API itself. A limitation of that approach though is that it would be difficult to set scenes as the output of a rule.

Ultimately I think scenes functionality should probably be built into the gateway application and also be supported by the rules engine (the same is true for groups).

We could start with an extension add-on to prototype a dedicated scenes UI, then consider adding scenes functionality directly into the gateway once it has matured?