Trigging ved bevegelse på dagtid og kveldstid

Prøver å lage en flow som trigger lys ved bevegelse på dagtid, for så å slå det av igjen, men etter 18.30 på kvelden, kun trigge det på, uten at det går av igjen.

legger ved flow kode og “chart” - noen ideer, inspill eller korreksjoner taes i mot med takk. Merker jeg har store problemer med å forstå når jeg skal bruke int, string og slike ting. prøvd å google litt rundt dette uten å bli klokere. F.eks når en ønsker en spesifikk set.lvl på spotter, bruker en da f.eks string 30?

{
  "Id": "qlx2vn7RIWU4m48",
  "ClassId": "qlx2vn7RIWU4m48",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2020-12-11T23:36:53.315896057+01:00",
  "UpdatedAt": "2020-12-11T23:36:53.315896057+01:00",
  "Name": "nightlight",
  "Description": "Triggers light on motion, but not at night",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "Bevegelsessensor trigget",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:sensor_presence/ad:62_0",
      "Service": "sensor_presence",
      "ServiceInterface": "evt.presence.report",
      "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": 552,
        "y": 115,
        "nodeType": ""
      },
      "TypeAlias": "Trigger"
    },
    {
      "Id": "2",
      "Type": "iftime",
      "Label": "Trigger-tidsrom",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "3",
      "ErrorTransition": "4",
      "Config": {
        "Expression": [
          {
            "Weekday": "1",
            "From": "09:00",
            "To": "18:30",
            "Action": "a"
          },
          {
            "Weekday": "2",
            "From": "09:00",
            "To": "18:30",
            "Action": "a"
          },
          {
            "Weekday": "3",
            "From": "09:00",
            "To": "18:30",
            "Action": "a"
          },
          {
            "Weekday": "4",
            "From": "09:00",
            "To": "18:30",
            "Action": "a"
          },
          {
            "Weekday": "5",
            "From": "09:00",
            "To": "18:30",
            "Action": "a"
          },
          {
            "Weekday": "6",
            "From": "09:00",
            "To": "18:30",
            "Action": "a"
          },
          {
            "Weekday": "0",
            "From": "09:00",
            "To": "18:30",
            "Action": "a"
          }
        ]
      },
      "Ui": {
        "x": 844,
        "y": 121,
        "nodeType": ""
      },
      "TypeAlias": "Time filter"
    },
    {
      "Id": "3",
      "Type": "if",
      "Label": "true",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "TrueTransition": "6",
        "FalseTransition": "",
        "Expression": [
          {
            "Operand": "eq",
            "LeftVariableName": "",
            "LeftVariableIsGlobal": false,
            "RightVariable": {
              "Value": true,
              "ValueType": "bool"
            },
            "BooleanOperator": ""
          }
        ]
      },
      "Ui": {
        "x": 662,
        "y": 304,
        "nodeType": ""
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "4",
      "Type": "if",
      "Label": "false",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "TrueTransition": "5",
        "FalseTransition": "",
        "Expression": [
          {
            "Operand": "eq",
            "LeftVariableName": "",
            "LeftVariableIsGlobal": false,
            "RightVariable": {
              "Value": false,
              "ValueType": "bool"
            },
            "BooleanOperator": ""
          }
        ]
      },
      "Ui": {
        "x": 952,
        "y": 301,
        "nodeType": ""
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "5",
      "Type": "action",
      "Label": "spotter natt",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:136_0",
      "Service": "out_lvl_switch",
      "ServiceInterface": "cmd.lvl.set",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "",
        "DefaultValue": {
          "Value": "15",
          "ValueType": "string"
        }
      },
      "Ui": {
        "x": 963,
        "y": 487,
        "nodeType": ""
      },
      "TypeAlias": "Action"
    },
    {
      "Id": "6",
      "Type": "action",
      "Label": "Spotter dagtid",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:136_0",
      "Service": "out_lvl_switch",
      "ServiceInterface": "cmd.lvl.set",
      "SuccessTransition": "7",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "",
        "DefaultValue": {
          "Value": "30",
          "ValueType": "string"
        }
      },
      "Ui": {
        "x": 657,
        "y": 492,
        "nodeType": ""
      },
      "TypeAlias": "Action"
    },
    {
      "Id": "7",
      "Type": "wait",
      "Label": "10min deteksjonstid",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "SuccessTransition": "8",
      "ErrorTransition": "",
      "Config": 1000,
      "Ui": {
        "x": 653,
        "y": 694,
        "nodeType": ""
      },
      "TypeAlias": "Delay"
    },
    {
      "Id": "8",
      "Type": "action",
      "Label": "spotter av",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:136_0",
      "Service": "out_lvl_switch",
      "ServiceInterface": "cmd.binary.set",
      "SuccessTransition": "",
      "ErrorTransition": "",
      "Config": {
        "VariableName": "",
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {},
        "ResponseToTopic": "",
        "DefaultValue": {
          "Value": false,
          "ValueType": "bool"
        }
      },
      "Ui": {
        "x": 961,
        "y": 686,
        "nodeType": ""
      },
      "TypeAlias": "Action"
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": ""
}

Denne er veldig fin å bruke for å finne ut av value typer osv👍🏻 Et annet alternativ er jo å bruke message stream og se hva som rapporteres der når man f.eks dimmer opp et lys.

Det er riktig som du sier at det er int og f.eks 30 du setter som verdi på en dimmer ja😊

Takk - dette var lærerikt :slight_smile: Ser foreløpig ut som flow fungerer utmerket :slight_smile: Får se i kveld om den trigger, og blir stående (Ungene er mørkredd om de våkner om natten, så gangen må ha svakt lys i tak - så på noen SG veggspotter jeg har liggende også, men blir ikke kraftig nok slik jeg ser det :frowning: )

1 Like

Dette fungerte utmerket :grin: mrk: på innlimt kode er det string, ikke int. Dette er endret​:+1:

1 Like

:clap:
du kan endre flowen med edit knapp, så om noen ønsker å kopiere den, så er den riktig :ok_hand:

{
  "Id": "qlx2vn7RIWU4m48",
  "ClassId": "qlx2vn7RIWU4m48",
  "Author": "",
  "Version": 0,
  "CreatedAt": "2020-12-11T23:36:53.315896057+01:00",
  "UpdatedAt": "2020-12-18T21:14:57.710723668+01:00",
  "Name": "nightlight",
  "Group": "",
  "Description": "Triggers light on motion, but not at night",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "Bevegelsessensor trigget",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:sensor_presence/ad:62_0",
      "Service": "sensor_presence",
      "ServiceInterface": "evt.presence.report",
      "Config": {
        "ConnectorID": "",
        "InputVariableType": "",
        "IsValueFilterEnabled": true,
        "LookupServiceNameAndLocation": false,
        "PropFilterName": "",
        "PropFilterValue": "",
        "RegisterAsVirtualService": false,
        "Timeout": 0,
        "ValueFilter": {
          "Value": true,
          "ValueType": "bool"
        },
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "nodeType": "",
        "x": 552,
        "y": 115
      },
      "TypeAlias": "Trigger"
    },
    {
      "Id": "2",
      "Type": "iftime",
      "Label": "Trigger-tidsrom",
      "SuccessTransition": "3",
      "TimeoutTransition": "",
      "ErrorTransition": "4",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "Action": "a",
            "From": "09:00",
            "To": "18:30",
            "Weekday": "1"
          },
          {
            "Action": "a",
            "From": "09:00",
            "To": "18:30",
            "Weekday": "2"
          },
          {
            "Action": "a",
            "From": "09:00",
            "To": "18:30",
            "Weekday": "3"
          },
          {
            "Action": "a",
            "From": "09:00",
            "To": "18:30",
            "Weekday": "4"
          },
          {
            "Action": "a",
            "From": "09:00",
            "To": "18:30",
            "Weekday": "5"
          },
          {
            "Action": "a",
            "From": "09:00",
            "To": "18:30",
            "Weekday": "6"
          },
          {
            "Action": "a",
            "From": "09:00",
            "To": "18:30",
            "Weekday": "0"
          }
        ]
      },
      "Ui": {
        "nodeType": "",
        "x": 844,
        "y": 121
      },
      "TypeAlias": "Time filter"
    },
    {
      "Id": "3",
      "Type": "if",
      "Label": "true",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "BooleanOperator": "",
            "LeftVariableIsGlobal": false,
            "LeftVariableName": "",
            "Operand": "eq",
            "RightVariable": {
              "Value": true,
              "ValueType": "bool"
            }
          }
        ],
        "FalseTransition": "",
        "TrueTransition": "6"
      },
      "Ui": {
        "nodeType": "",
        "x": 662,
        "y": 304
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "4",
      "Type": "if",
      "Label": "false",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "BooleanOperator": "",
            "LeftVariableIsGlobal": false,
            "LeftVariableName": "",
            "Operand": "eq",
            "RightVariable": {
              "Value": false,
              "ValueType": "bool"
            }
          }
        ],
        "FalseTransition": "",
        "TrueTransition": "5"
      },
      "Ui": {
        "nodeType": "",
        "x": 952,
        "y": 301
      },
      "TypeAlias": "If condition"
    },
    {
      "Id": "5",
      "Type": "action",
      "Label": "spotter natt",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:136_0",
      "Service": "out_lvl_switch",
      "ServiceInterface": "cmd.lvl.set",
      "Config": {
        "DefaultValue": {
          "Value": "15",
          "ValueType": "int"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 963,
        "y": 487
      },
      "TypeAlias": "Action"
    },
    {
      "Id": "6",
      "Type": "action",
      "Label": "Spotter dagtid",
      "SuccessTransition": "7",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:136_0",
      "Service": "out_lvl_switch",
      "ServiceInterface": "cmd.lvl.set",
      "Config": {
        "DefaultValue": {
          "Value": "30",
          "ValueType": "int"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 657,
        "y": 492
      },
      "TypeAlias": "Action"
    },
    {
      "Id": "7",
      "Type": "wait",
      "Label": "10min deteksjonstid",
      "SuccessTransition": "8",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": 600000,
      "Ui": {
        "nodeType": "",
        "x": 653,
        "y": 694
      },
      "TypeAlias": "Delay"
    },
    {
      "Id": "8",
      "Type": "action",
      "Label": "spotter av",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:zw/ad:1/sv:out_lvl_switch/ad:136_0",
      "Service": "out_lvl_switch",
      "ServiceInterface": "cmd.binary.set",
      "Config": {
        "DefaultValue": {
          "Value": false,
          "ValueType": "bool"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 961,
        "y": 686
      },
      "TypeAlias": "Action"
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": "parallel"
}

da er flow oppdatert :slight_smile: også endret timing/holdetid for lyset av hensyn til retrigging tid/cooldown på triggingen til motion sensor. dette er lagt inn i ny flow :slight_smile:

1 Like