Logical operations

This recipe uses

This example can be operated the best on the web ui as there are no pins assigned.

Logic Elements UI

By using 2 Switch Elements to control 2 boolean input values.

These values are sent to 2 logical elements the AND Element and the OR Element where the calculated outputs are displayed.

{
  "switch": {
    "in1": {
      "onvalue": "and/a?value[0]=$v,or/o?value[0]=$v"
    },
    "in2": {
      "onvalue": "and/a?value[1]=$v,or/o?value[1]=$v"
    }
  },
  "and": {
    "a": {
      "description": "Logical AND",
      "invert": "false",
      "value": [
        "true",
        "false"
      ],
      "onvalue": "device/0?log=AND:$v",
      "title": "and/a"
    }
  },
  "or": {
    "o": {
      "description": "Logical OR",
      "invert": "false",
      "value": [
        "true",
        "false"
      ],
      "onvalue": "device/0?log=OR:$v",
      "title": "or/o"
    }
  }
}

See also

Tags

Recipe