sendNotification in OpenHAB3 Rules

I have a rule on an OH2 system using a GPIO on the RasPI that works as follows:

rule "FrontDoorOpen"
when
  Item FrontDoor changed
then
  if (FrontDoor.state == OPEN) {
    sendNotification("myemail@address", "Front Door Has Been Opened")
  }
end

How do I enter the sendNotification line in the new graphical OpenHAB3 Rule editor?

Thanks

The same way.

Create the rule.

Add the Trigger.

Add a Script Action.

Choose Rules DSL as the language.

Paste the code between “then” and “end”.

  if (FrontDoor.state == OPEN) {
    sendNotification("myemail@address", "Front Door Has Been Opened")
  }
1 Like

Thanks for the very quick responses over the years @rlkoshak! That was exactly what I was looking for. It works perfectly.

This is probably in the documentation somewhere, but I have to admit I missed it. FWIW, what does DSL stand for?

Domain Specific Language. Rules DSL is a custom programming language invented and used in the domain of openHAB. This is opposed to a general programming language like JavaScript which is written to write almost any kind of program, not just openHAB rules.