I need make two actions under my widget when icon is clicked - open window a start a rule.
Open window I have already implemented, but to start a rule I need set any item to any value, but I think oh-icon doesn’t support more actions. How to do it ?
You can set the action in the widget to call the rule. You didn’t need a separate item.
You need to configure MainUI with a command Item under Help and About → Listen for UI commands to. Help & About Page | openHAB describes what the command needs to be.
sorry I really do not understand what you mean. As I wrote, I want make two actions when oh-icon is clicked.
Information was - you must do it via rule.
So my idea is, that oh-icon will set any item to state “start” and this “start” will run a rule where more actions is. Problem is, what is correct DSL instruction which will do the same as this :
action: popup
actionModal: page:page_aa2a78d3a1
edit: or is there any “special” instruction to start a rule directly ? but it looks complicated
Once MainUI is configured to listen for commands from an Item, let’s call the Item Foo.
Then the the code is just:
Foo.sendCommand("popup:page_aa2a78d3a1")
as described in the docs I linked to:
Currently, the supported commands are:
…
popup:$target, popover:$target and sheet:$target: Open a $target, which can be a page ($target is page: + a page ID), a custom widget ($target is widget: + widget ID) or any oh- component ($target is the component name), in a popup, popover or sheet.
For example, to open oh-clock-card inside a popup, send popup:oh-clock-card to the UI command Item.
Or you can use @JustinG’s approach to do two actions.
It is easiest to configure if the parent component is an oh-link. I can’t see any reason why it would matter at all what type of component you use for the child, so: