openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

Add rules management to sitemaps

Open fabgio opened this issue 1 year ago • 12 comments

Thus far sitemaps can only manage items still It would be a good point if they could also control rules( implementing at least start/stop functions)

fabgio avatar Oct 20 '23 15:10 fabgio

@lolodomo @wborn I am a newbe at openhab-core development; How to get started?I have been studying org.openhab.core.io.rest.sitemap.internal and org.openhab.core.model.rule.runtime.internal packages any tip?

fabgio avatar Oct 20 '23 15:10 fabgio

There really isn't a stop for rules. There are only three operations: start, disable, and enable. Disable and enable are more admin function and not something that seems appropriate for a sitemap.

In the mean time, the standard approach is to create an Item that triggers the rule when commanded.

MainUI does have support for an action to run a rule, and you can even pass data into the rule. So there is precedence for this feature in OH.

rkoshak avatar Oct 20 '23 15:10 rkoshak

Good points....

fabgio avatar Oct 20 '23 15:10 fabgio

Also, this probably belongs in the openhab-webuis repo. I don't think there is anything required in core to support this. The REST API endpoint already exists. All the changes required should be limited to the sitemap implementation. Though there might also need to be some updates to the Android and iOS app too.

rkoshak avatar Oct 20 '23 15:10 rkoshak

Change in core is required in case a change of sitemap syntax is expected.

What is requested is a new widget (sitemap element) to control the start of a rule?

lolodomo avatar Oct 20 '23 19:10 lolodomo

What rendering do you imagine in UI?

lolodomo avatar Oct 20 '23 19:10 lolodomo

Exactly! A new widget to control rules' enable/disable function as happens in the web ui

fabgio avatar Oct 20 '23 19:10 fabgio

I can imagine rules widgets with the controls beside....

fabgio avatar Oct 20 '23 19:10 fabgio

As already explained, enabling/ disabling a rule is an admin feature, not something that should be available in sitemap UI.

lolodomo avatar Oct 20 '23 19:10 lolodomo

I interpreted it to mean adding the ability to run a rule instead of commanding an Item. I could see it being an enhancement to the Switch element instead of needing a whole new sitemap element. But I don't know if that's the easier or harder way to implement it.

rkoshak avatar Oct 20 '23 21:10 rkoshak

Why was it closed ?

lolodomo avatar Nov 01 '23 17:11 lolodomo

I thought there was no way to handle it. Do you think it is feasible? -8)

Il Mer 1 Nov 2023, 18:09 lolodomo @.***> ha scritto:

Why was it closed ?

— Reply to this email directly, view it on GitHub https://github.com/openhab/openhab-core/issues/3855#issuecomment-1789334433, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZHU6H572C5IPD4EGCZDX3YCJ66DAVCNFSM6AAAAAA6JFRPNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBZGMZTINBTGM . You are receiving this because you modified the open/close state.Message ID: @.***>

fabgio avatar Nov 01 '23 17:11 fabgio

Main concept of sitemap UIs is to interact with items. I propose to give up this feature request.

lolodomo avatar May 02 '24 18:05 lolodomo