Hei,
Jeg prøver å lage en flow som kjører når Danalocken blir låst opp (Message stream):
{
"serv": "door_lock",
"type": "evt.lock.report",
"val_t": "bool_map",
"val": {
"bolt_is_locked": false,
"door_is_closed": false,
"is_secured": false,
"latch_is_closed": false
},
"props": {
"timeout_s": "254",
"unsecured_desc": ""
},
"tags": null,
"src": "-",
"ver": "1",
"uid": "f3666a17-4b9e-40dd-8979-b109cba10eb3",
"topic": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:door_lock/ad:131_0"
}
og når den blir låst igjen (Message stream):
{
"serv": "door_lock",
"type": "evt.lock.report",
"val_t": "bool_map",
"val": {
"bolt_is_locked": true,
"door_is_closed": true,
"is_secured": true,
"latch_is_closed": true
},
"props": {
"timeout_s": "254",
"unsecured_desc": "secured"
},
"tags": null,
"src": "-",
"ver": "1",
"uid": "2c2e064f-1e65-4760-8214-ff2fe40424dc",
"topic": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:door_lock/ad:131_0"
}
men jeg sliter litt med å finne ut hva jeg skal velge i “triggeren” og i “if” noden som kommer etterpå.
Noen kloke hoder som kan gi meg et hint?
Log fra flowen:
2022-09-19 16:49:00.356 | debug | flow | ------Flow Dør sensor push started, num of instances = 1 ----------- | ||
---|---|---|---|---|---|
2022-09-19 16:49:00.356 | debug | flow | Next node id = 30 | ||
2022-09-19 16:49:00.357 | error | flow | Node failed with error: right and left variables of expression have different types | ||
2022-09-19 16:49:00.357 | debug | flow | Next node id = | ||
2022-09-19 16:49:00.357 | debug | flow | ------Flow Dør sensor push completed, num of instances = 0 ----------- |
Flow:
{
"Id": "9c0221e0-fef9-11ec-97f3-5127fc76a2a8",
"ClassId": "9c0221e0-fef9-11ec-97f3-5127fc76a2a8",
"Author": "",
"Version": 0,
"CreatedAt": "2022-07-08T20:07:35.93437Z",
"UpdatedAt": "2022-09-19T16:34:15.770836572+02:00",
"Name": "Dør sensor push",
"Group": "Diverse",
"Description": "",
"Nodes": [
{
"Id": "29",
"Type": "trigger",
"Label": "garasjedørlås",
"SuccessTransition": "30",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:door_lock/ad:131_0",
"Service": "door_lock",
"ServiceInterface": "evt.lock.report",
"Config": {
"IsValueFilterEnabled": false,
"LookupServiceNameAndLocation": false,
"RegisterAsVirtualService": false,
"Timeout": 0,
"ValueFilter": {
"Value": "",
"ValueType": "bool_map"
},
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 1390,
"y": 266
},
"TypeAlias": "Trigger"
},
{
"Id": "30",
"Type": "if",
"Label": "",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "",
"Operand": "eq",
"RightVariable": {
"Value": true,
"ValueType": "bool"
}
}
],
"FalseTransition": "32",
"TrueTransition": "31"
},
"Ui": {
"nodeType": "",
"x": 1383,
"y": 470
},
"TypeAlias": "If condition"
},
{
"Id": "31",
"Type": "set_variable",
"Label": "garasjedør",
"SuccessTransition": "33",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"DefaultValue": {
"Value": "open",
"ValueType": "string"
},
"IsVariableInMemory": false,
"Name": "garasjedor",
"UpdateGlobal": true,
"UpdateInputMsg": false
},
"Ui": {
"nodeType": "",
"x": 1197,
"y": 628
},
"TypeAlias": "Set variable"
},
{
"Id": "32",
"Type": "set_variable",
"Label": "garasjedør",
"SuccessTransition": "34",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"DefaultValue": {
"Value": "closed",
"ValueType": "string"
},
"IsVariableInMemory": false,
"Name": "garasjedor",
"UpdateGlobal": true,
"UpdateInputMsg": false
},
"Ui": {
"nodeType": "",
"x": 1477,
"y": 645
},
"TypeAlias": "Set variable"
},
{
"Id": "33",
"Type": "action",
"Label": "Publish timeline",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:app/rn:time_owl/ad:1",
"Service": "time_owl",
"ServiceInterface": "cmd.timeline.set",
"Config": {
"DefaultValue": {
"Value": {
"message_en": "Garasjedør åpnet.",
"message_no": "Garasjedør åpnet.",
"sender": "flow"
},
"ValueType": "str_map"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "timeline_action",
"x": 1186,
"y": 817
},
"TypeAlias": "Timeline"
},
{
"Id": "34",
"Type": "action",
"Label": "Publish timeline",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:app/rn:time_owl/ad:1",
"Service": "time_owl",
"ServiceInterface": "cmd.timeline.set",
"Config": {
"DefaultValue": {
"Value": {
"message_en": "Garasjedør lukket.",
"message_no": "Garasjedør lukket.",
"sender": "flow"
},
"ValueType": "str_map"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "timeline_action",
"x": 1468,
"y": 816
},
"TypeAlias": "Timeline"
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": "keep_first"
}