ID Lock 150

Den henter bare ut verdien og ikke hvilken type det er (string/bool/int osv). Det blir satt i transformnode 2. Mulig det skal være mulig å gjøre det i første node, men fikk det ikke til her og nå.

Kan du prøve denne? :slightly_smiling_face: Du må kun endre adressen på trigger noden. Fra 39_0 til addressen på din lås på Advanced service binding

Denne setter hjemmemodus om døren blir låst opp i bortemodus :slight_smile:

{
  "Id": "re5yNE05vMXqe5W",
  "ClassId": "g2FQ08dkJWoHuun",
  "Author": "espenh.no",
  "Version": 0,
  "CreatedAt": "2020-07-24T22:36:18.507632407+02:00",
  "UpdatedAt": "2020-07-24T22:36:18.507632407+02:00",
  "Name": "home if door is unlocked in away",
  "Group": "doorlock_test",
  "Description": "home if door is unlocked in away",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "doorlock",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:door_lock/ad:39_0",
      "Service": "door_lock",
      "ServiceInterface": "evt.lock.report",
      "Config": {
        "InputVariableType": "",
        "IsValueFilterEnabled": false,
        "LookupServiceNameAndLocation": false,
        "PropFilterName": "",
        "PropFilterValue": "",
        "RegisterAsVirtualService": false,
        "Timeout": 0,
        "ValueFilter": {
          "Value": null,
          "ValueType": ""
        },
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "nodeType": "",
        "x": 153,
        "y": 199
      }
    },
    {
      "Id": "2",
      "Type": "transform",
      "Label": "extract value",
      "SuccessTransition": "3",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": "",
        "IsLVariableGlobal": false,
        "IsRVariableGlobal": false,
        "IsTargetVariableGlobal": false,
        "IsTargetVariableInMemory": true,
        "LVariableName": "",
        "RValue": {
          "Value": 0,
          "ValueType": "int"
        },
        "RVariableName": "",
        "Rtype": "var",
        "TargetVariableName": "",
        "TargetVariableType": "",
        "Template": "",
        "TransformType": "jpath",
        "ValueMapping": [],
        "XPathMapping": [
          {
            "IsTargetVariableGlobal": false,
            "Path": "$.val.is_secured",
            "TargetVariableName": "",
            "TargetVariableType": "",
            "UpdateInputVariable": false
          }
        ]
      },
      "Ui": {
        "nodeType": "",
        "x": 177,
        "y": 364
      }
    },
    {
      "Id": "3",
      "Type": "transform",
      "Label": "generate variable",
      "SuccessTransition": "4",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": "",
        "IsLVariableGlobal": false,
        "IsRVariableGlobal": false,
        "IsTargetVariableGlobal": false,
        "IsTargetVariableInMemory": true,
        "LVariableName": "",
        "RValue": {
          "Value": 0,
          "ValueType": "int"
        },
        "RVariableName": "",
        "Rtype": "var",
        "TargetVariableName": "is_secured",
        "TargetVariableType": "bool",
        "Template": "{{.Variable}}",
        "TransformType": "template",
        "ValueMapping": [],
        "XPathMapping": []
      },
      "Ui": {
        "nodeType": "",
        "x": 246,
        "y": 558
      }
    },
    {
      "Id": "4",
      "Type": "if",
      "Label": "if is_secured is false and mode is away",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "BooleanOperator": "and",
            "LeftVariableIsGlobal": false,
            "LeftVariableName": "is_secured",
            "Operand": "eq",
            "RightVariable": {
              "Value": false,
              "ValueType": "bool"
            }
          },
          {
            "BooleanOperator": "",
            "LeftVariableIsGlobal": true,
            "LeftVariableName": "fh.home.mode",
            "Operand": "eq",
            "RightVariable": {
              "Value": "away",
              "ValueType": "string"
            }
          }
        ],
        "FalseTransition": "",
        "TrueTransition": "5"
      },
      "Ui": {
        "nodeType": "",
        "x": 288,
        "y": 740
      }
    },
    {
      "Id": "5",
      "Type": "action",
      "Label": "Home action",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1",
      "Service": "vinculum",
      "ServiceInterface": "cmd.pd7.request",
      "Config": {
        "DefaultValue": {
          "Value": {
            "cmd": "set",
            "component": "mode",
            "id": "home",
            "param": {},
            "requestId": 1
          },
          "ValueType": "object"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "pt:j1/mt:rsp/rt:app/rn:tpflow/ad:1",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "vinc_action",
        "x": 322,
        "y": 895
      }
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": "keep_first"
}

Om det ikke virker; prøv å opprett en variabel med navn is_secured & type bool

2 Likes