Sette modus med dørlås

prøver å lage en flow som setter modus via dørlås kombinert med bevegelsessensor i entre.
Tanken er at den skal, ved låsing, sette modus hjemme eller søvn, avhengig av tid på døgnet, om det er bevegelse. Er det ikke bevegelse - altså at låsen låses med panel eller nøkkel fra utsiden, så settes bortemodus. Feedback på flow ønskes! Har ikke testet den enda - kom gjerne med korreksjoner, enklere løsninger osv!

{
  "Id": "bfT5rBZE6ycD3Cm",
  "ClassId": "bfT5rBZE6ycD3Cm",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2020-12-18T21:15:26.265676557+01:00",
  "UpdatedAt": "2020-12-18T21:15:26.265676557+01:00",
  "Name": "away door mode",
  "Description": "sets away mode when locked and no motion",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "door locked",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:door_lock/ad:198_0",
      "Service": "door_lock",
      "ServiceInterface": "cmd.lock.set",
      "Config": {
        "Timeout": 0,
        "ConnectorID": "",
        "ValueFilter": {
          "Value": true,
          "ValueType": "bool"
        },
        "PropFilterName": "",
        "PropFilterValue": "",
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "InputVariableType": "",
        "IsValueFilterEnabled": true,
        "RegisterAsVirtualService": false,
        "LookupServiceNameAndLocation": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "x": 643,
        "y": 95,
        "nodeType": ""
      },
      "TypeAlias": "Trigger"
    },
    {
      "Id": "2",
      "Type": "action",
      "Label": "motion detected",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:sensor_presence/ad:207_0",
      "Service": "sensor_presence",
      "ServiceInterface": "evt.presence.report",
      "SuccessTransition": "3",
      "ErrorTransition": "4",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "",
        "DefaultValue": {
          "Value": true,
          "ValueType": "bool"
        }
      },
      "Ui": {
        "x": 900,
        "y": 98,
        "nodeType": ""
      },
      "TypeAlias": "Action"
    },
    {
      "Id": "3",
      "Type": "if",
      "Label": "true",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "TrueTransition": "5",
        "FalseTransition": "6",
        "Expression": [
          {
            "Operand": "eq",
            "LeftVariableName": "",
            "LeftVariableIsGlobal": false,
            "RightVariable": {
              "Value": true,
              "ValueType": "bool"
            },
            "BooleanOperator": ""
          }
        ]
      },
      "Ui": {
        "x": 771,
        "y": 309,
        "nodeType": ""
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "4",
      "Type": "if",
      "Label": "false",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "TrueTransition": "9",
        "FalseTransition": "",
        "Expression": [
          {
            "Operand": "eq",
            "LeftVariableName": "",
            "LeftVariableIsGlobal": false,
            "RightVariable": {
              "Value": false,
              "ValueType": "bool"
            },
            "BooleanOperator": ""
          }
        ]
      },
      "Ui": {
        "x": 1010,
        "y": 309,
        "nodeType": ""
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "5",
      "Type": "iftime",
      "Label": "day",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "7",
      "ErrorTransition": "",
      "Config": {
        "Expression": [
          {
            "Weekday": "1",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "2",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "3",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "4",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "5",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "6",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "0",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          }
        ]
      },
      "Ui": {
        "x": 516,
        "y": 468,
        "nodeType": ""
      },
      "TypeAlias": "Time filter"
    },
    {
      "Id": "6",
      "Type": "iftime",
      "Label": "night",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "8",
      "ErrorTransition": "",
      "Config": {
        "Expression": [
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          }
        ]
      },
      "Ui": {
        "x": 753,
        "y": 465,
        "nodeType": ""
      },
      "TypeAlias": "Time filter"
    },
    {
      "Id": "7",
      "Type": "action",
      "Label": "Hjemme modus",
      "Address": "pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1",
      "Service": "vinculum",
      "ServiceInterface": "cmd.pd7.request",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "pt:j1/mt:rsp/rt:app/rn:tpflow/ad:1",
        "DefaultValue": {
          "Value": {
            "cmd": "set",
            "component": "mode",
            "id": "home",
            "param": {},
            "requestId": 1
          },
          "ValueType": "object"
        }
      },
      "Ui": {
        "x": 509,
        "y": 616,
        "nodeType": "vinc_action"
      },
      "TypeAlias": "Home mode"
    },
    {
      "Id": "8",
      "Type": "action",
      "Label": "Natt",
      "Address": "pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1",
      "Service": "vinculum",
      "ServiceInterface": "cmd.pd7.request",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "pt:j1/mt:rsp/rt:app/rn:tpflow/ad:1",
        "DefaultValue": {
          "Value": {
            "cmd": "set",
            "component": "mode",
            "id": "sleep",
            "param": {},
            "requestId": 1
          },
          "ValueType": "object"
        }
      },
      "Ui": {
        "x": 756,
        "y": 613,
        "nodeType": "vinc_action"
      },
      "TypeAlias": "Home mode"
    },
    {
      "Id": "9",
      "Type": "action",
      "Label": "Borte",
      "Address": "pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1",
      "Service": "vinculum",
      "ServiceInterface": "cmd.pd7.request",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "pt:j1/mt:rsp/rt:app/rn:tpflow/ad:1",
        "DefaultValue": {
          "Value": {
            "cmd": "set",
            "component": "mode",
            "id": "away",
            "param": {},
            "requestId": 1
          },
          "ValueType": "object"
        }
      },
      "Ui": {
        "x": 1004,
        "y": 471,
        "nodeType": "vinc_action"
      },
      "TypeAlias": "Home mode"
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": ""
}

det jeg stusser litt over er at jeg på action, der jeg valgte motion sensor, også måtte sette true/false - hvorpå jeg gjentar true/false på begge IF kortene…

Etter å ha sett litt kjapt på den, så ser jeg at her blir det vel feil med action på motion sensor, da flowen vil sende evt.presence.report true hver gang døra låses.

Tror du må løse det med å ha motion sensor som trigger ved siden av, som så setter true/false i en variabel.
Da kan du bruke den variabelen if nodene👍🏻

1 Like

Ja, såklart :laughing: løsningen var rett forran nesen på meg - jeg visste det var noe jeg misset der. Takk!
Litt for trøtt på en fredag, og nedi 3dje øl’en når en bestemmer seg for å mekke en flow sammen en har gått å grublet litt på, på jobb :see_no_evil:

1 Like
{
  "Id": "bfT5rBZE6ycD3Cm",
  "ClassId": "bfT5rBZE6ycD3Cm",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2020-12-18T21:15:26.265676557+01:00",
  "UpdatedAt": "2020-12-18T21:15:26.265676557+01:00",
  "Name": "away door mode",
  "Description": "sets away mode when locked and no motion",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "door locked",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:door_lock/ad:198_0",
      "Service": "door_lock",
      "ServiceInterface": "cmd.lock.set",
      "Config": {
        "Timeout": 0,
        "ConnectorID": "",
        "ValueFilter": {
          "Value": true,
          "ValueType": "bool"
        },
        "PropFilterName": "",
        "PropFilterValue": "",
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "InputVariableType": "",
        "IsValueFilterEnabled": true,
        "RegisterAsVirtualService": false,
        "LookupServiceNameAndLocation": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "x": 643,
        "y": 95,
        "nodeType": ""
      },
      "TypeAlias": "Trigger"
    },
    {
      "Id": "2",
      "Type": "action",
      "Label": "motion detected",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:sensor_presence/ad:207_0",
      "Service": "sensor_presence",
      "ServiceInterface": "evt.presence.report",
      "SuccessTransition": "3",
      "ErrorTransition": "4",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "",
        "DefaultValue": {
          "Value": true,
          "ValueType": "bool"
        }
      },
      "Ui": {
        "x": 900,
        "y": 98,
        "nodeType": ""
      },
      "TypeAlias": "Action",
      "LastValue": false
    },
    {
      "Id": "3",
      "Type": "if",
      "Label": "true",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "TrueTransition": "5",
        "FalseTransition": "6",
        "Expression": [
          {
            "Operand": "eq",
            "LeftVariableName": "",
            "LeftVariableIsGlobal": false,
            "RightVariable": {
              "Value": true,
              "ValueType": "bool"
            },
            "BooleanOperator": ""
          }
        ]
      },
      "Ui": {
        "x": 771,
        "y": 309,
        "nodeType": ""
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "4",
      "Type": "if",
      "Label": "false",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "TrueTransition": "9",
        "FalseTransition": "",
        "Expression": [
          {
            "Operand": "eq",
            "LeftVariableName": "",
            "LeftVariableIsGlobal": false,
            "RightVariable": {
              "Value": false,
              "ValueType": "bool"
            },
            "BooleanOperator": ""
          }
        ]
      },
      "Ui": {
        "x": 1010,
        "y": 309,
        "nodeType": ""
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "5",
      "Type": "iftime",
      "Label": "day",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "7",
      "ErrorTransition": "",
      "Config": {
        "Expression": [
          {
            "Weekday": "1",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "2",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "3",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "4",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "5",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "6",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          },
          {
            "Weekday": "0",
            "From": "06:00",
            "To": "22:30",
            "Action": "a"
          }
        ]
      },
      "Ui": {
        "x": 516,
        "y": 468,
        "nodeType": ""
      },
      "TypeAlias": "Time filter"
    },
    {
      "Id": "6",
      "Type": "iftime",
      "Label": "night",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "8",
      "ErrorTransition": "",
      "Config": {
        "Expression": [
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          },
          {
            "Weekday": "1",
            "From": "22:31",
            "To": "05:59",
            "Action": "a"
          }
        ]
      },
      "Ui": {
        "x": 753,
        "y": 465,
        "nodeType": ""
      },
      "TypeAlias": "Time filter"
    },
    {
      "Id": "7",
      "Type": "action",
      "Label": "Hjemme modus",
      "Address": "pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1",
      "Service": "vinculum",
      "ServiceInterface": "cmd.pd7.request",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "pt:j1/mt:rsp/rt:app/rn:tpflow/ad:1",
        "DefaultValue": {
          "Value": {
            "cmd": "set",
            "component": "mode",
            "id": "home",
            "param": {},
            "requestId": 1
          },
          "ValueType": "object"
        }
      },
      "Ui": {
        "x": 509,
        "y": 616,
        "nodeType": "vinc_action"
      },
      "TypeAlias": "Home mode"
    },
    {
      "Id": "8",
      "Type": "action",
      "Label": "Natt",
      "Address": "pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1",
      "Service": "vinculum",
      "ServiceInterface": "cmd.pd7.request",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "pt:j1/mt:rsp/rt:app/rn:tpflow/ad:1",
        "DefaultValue": {
          "Value": {
            "cmd": "set",
            "component": "mode",
            "id": "sleep",
            "param": {},
            "requestId": 1
          },
          "ValueType": "object"
        }
      },
      "Ui": {
        "x": 756,
        "y": 613,
        "nodeType": "vinc_action"
      },
      "TypeAlias": "Home mode"
    },
    {
      "Id": "9",
      "Type": "action",
      "Label": "Borte",
      "Address": "pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1",
      "Service": "vinculum",
      "ServiceInterface": "cmd.pd7.request",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "pt:j1/mt:rsp/rt:app/rn:tpflow/ad:1",
        "DefaultValue": {
          "Value": {
            "cmd": "set",
            "component": "mode",
            "id": "away",
            "param": {},
            "requestId": 1
          },
          "ValueType": "object"
        }
      },
      "Ui": {
        "x": 1004,
        "y": 471,
        "nodeType": "vinc_action"
      },
      "TypeAlias": "Home mode"
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": ""
}

Lurer på om du delte samme flowen på nytt nå?

Kan se sånn ut - my bad! Poster ny i morgen👍

Har du fått den til å fungere som tenkt?:blush: