eminf
(eminf)
November 29, 2021, 11:59am
1
Hello all!
I am trying to recreate the same rules I had at Openhab2 rule engine on Openhab3. I want to send a mail whenever a door sensor changes to OPEN. The rules I am describing work fine on OH2. I cannot find the action of smtb server when adding a new rule. Here are some screenshots of the issue.
Old OH2 rules (white) VS New OH3 rules(black)
The Send HTML mail is not appearing although I have mail binding installed. Any idea?
Thanks!
wborn
(Wouter Born)
November 29, 2021, 12:34pm
2
I think add-on actions are hidden because of issues:
opened 02:35PM - 21 Oct 20 UTC
automation
UI
This is a follow-up issue of https://github.com/eclipse-archived/smarthome/issue… s/6602 as no solution has been implemented yet and we need to track it for OH3 release.
While implementing and testing my port of the Pushover add-on (https://github.com/openhab/openhab-addons/pull/8586) I again stumbled upon this missing feature. Currently it is not possible to configure inputs for Binding actions based on `ThingActions`. The annotated inputs are not visible in UIs.
![image](https://user-images.githubusercontent.com/5131747/96733029-499f8280-13b9-11eb-89c9-ec4342cd8a54.png)
```java
@RuleAction(label = "@text/sendHTMLMessageActionLabel", description = "@text/sendHTMLMessageActionDescription")
public @ActionOutput(name = "sent", label = "@text/sendMessageActionOutputLabel", description = "@text/sendMessageActionOutputDescription", type = "java.lang.Boolean") Boolean sendHtmlMessage(
@ActionInput(name = "message", label = "@text/sendMessageActionInputMessageLabel", description = "@text/sendMessageActionInputMessageDescription", type = "java.lang.String", required = true) String message,
@ActionInput(name = "title", label = "@text/sendMessageActionInputTitleLabel", description = "@text/sendMessageActionInputTitleDescription", type = "java.lang.String") @Nullable String title) {
logger.trace("ThingAction 'sendHtmlMessage' called with value(s): message='{}', title='{}'", message, title);
return send(getDefaultPushoverMessageBuilder(message).withHtmlFormatting(), title);
}
```
Internal automation actions like `say` or `playSound` define next to the inputs a list of configuration descriptions matching their inputs.
Conclusions of https://github.com/eclipse-archived/smarthome/issues/6602 are:
- No short term solution to add support for input in the UIs. Proposal is to hide all ThingActions.
- The is uncertainty about when to use inputs and when to use configuration descriptions (e.g. currently all existing core actions for NGRE defined them twice, an input and a related configuration).
Question is how to proceed? Should we hide all `ThingActions` in the near future? Or would it be an option to introduce a way to add configuration descriptions to `ThingActions` (e.g. by adding a new annotation for it)?
A previous private discussion between @kaikreuzer , @ghys , @openhab-5iver and myself resulted in the following brainstorming:
- Displaying inputs along with config parameters should be doable to configure an action instance in a rule.
- Apparently inputs have a type which is referenced in the API as a Java type (like java.lang.String or org.eclipse.smarthome.core.types.Command or org.eclipse.smarthome.core.events.Event), that’s a little bit different to the config parameters whose type is “TEXT” etc. Supporting anything other than primitive types in the UI could be tricky.
- Given a module type like:
![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/a/8/a8bb67408bd1e0d4d226f21c280c7d89705f2743.png)
and a rule like:
![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/2/a/2a1f0e99141f02f579902586b9001bf672544ff7.png)
I’m not sure how inputs are to be configured here, I suppose in the simplest case it’s something like below, with what the user configured in input boxes. But what if you want to use an output from another module?
```
"inputs": {
"topic": "some/topic",
"value": "somevalue"
}
```
- It is also IMO not exactly clear which inputs are to be presented to the user and which are “technical” (for example “event” in GenericEventCondition or “input” in CompareCondition).
- The ItemCommandAction module type has both a “command” input and a “command” config parameter described as “the default command to be sent if none is passed as an input value” - this would be confusing for users if both were displayed.
rossko57
(Rossko57)
November 29, 2021, 12:50pm
3
You’d need to use the binding-supplied send mail Action in a script section of your GUI defined rule.
eminf
(eminf)
November 29, 2021, 1:40pm
4
hey rossko! I dont think I understand what you mean… I cannot even see the actions on the dropdown list. Can you please elaborate more on this? Cheers!!!
rossko57
(Rossko57)
November 29, 2021, 1:47pm
5
I mean that you have to type in script for your rule to run. Clicky drop-downs cannot accomplish everything.
eminf
(eminf)
November 29, 2021, 1:57pm
6
Yes you are right. I tried the script execution already to send mail as described in previous topics on this forum. My problem is the clicky stuff itself…
system
(system)
Closed
January 10, 2022, 5:58am
7
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.