OH3: Notification Syntax in Rules?

What is the correct syntax in OH3 for SendNotification in the Rules GUI? The following works perfectly for sending an E-Mail with Text, Values, even a JPEG… but similar syntax sends everything as one text string verbatim,

triggers:
  - id: "2"
    configuration:
      itemName: ZWaveSensorCellar_MotionAlarm
      state: ON
      previousState: OFF
    type: core.ItemStateChangeTrigger
conditions: []
actions:
  - inputs: {}
    id: "1"
    configuration:
      message: ("Cellar - Alarm is" + ZWaveSensorCellar_MotionAlarm.state + ", Temp "
        + ZWaveSensorCellar_Sensortemperature.state + ", Humidity "
        +ZWaveSensorCellar_Sensorrelativehumidity.state +"% ")
      userId: me@my.email
    type: notification.SendNotification
  - inputs: {}
    id: "3"
    configuration:
      type: application/vnd.openhab.dsl.rule
      script: 'val mailActions = getActions("mail","mail:smtp:41a5fc752b")
        mailActions.sendMail("me@my.email", "Cellar", "Details: Alarm is " +
        ZWaveSensorCellar_MotionAlarm.state + ", Temp: " +
        ZWaveSensorCellar_Sensortemperature.state + ", Humidity: " +
        ZWaveSensorCellar_Sensorrelativehumidity.state +"% ",
        "http://192.168.xxx.xxx/snap.jpeg")'
    type: script.ScriptAction

FYI

  • ID1: The “Notification” was created using the GUI (and hence my syntax is worng)
  • ID3: The “E-Mail” was created using the old OH2 style script using the dsl rule

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.