Hei,
Jeg har en flow som gir beskjed når strømprisen er tilbake på snittivå
{
"Id": "d4d54080-f61e-11ec-9ba3-dd2b4bfa67f6",
"ClassId": "d4d54080-f61e-11ec-9ba3-dd2b4bfa67f6",
"Author": "kes-hol@online.no",
"Version": 0,
"CreatedAt": "2022-06-27T13:41:22.185037Z",
"UpdatedAt": "2022-07-03T10:49:28.322729383+02:00",
"Name": "strømprisen er 0.0% lavere enn gjennomsnittet og modusen er home, away eller sleep",
"Group": "custom",
"Description": "",
"Nodes": [
{
"Id": "93",
"Type": "trigger",
"Label": "strømprisen er 0.0% lavere enn gjennomsnittet",
"SuccessTransition": "94",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:app/rn:energy_guard/ad:1",
"Service": "energy_price",
"ServiceInterface": "evt.energy_price.report",
"Config": {
"InputVariableType": null,
"IsValueFilterEnabled": false,
"LookupServiceNameAndLocation": false,
"PropFilterName": "",
"PropFilterValue": "",
"RegisterAsVirtualService": false,
"Timeout": 0,
"ValueFilter": {
"Value": null,
"ValueType": null
},
"ValueJPath": null,
"ValueJPathResultType": null,
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": null,
"nodeName": "energy",
"nodeType": "energy"
},
"x": 108,
"y": 217
},
"TypeAlias": "Trigger"
},
{
"Id": "94",
"Type": "transform",
"Label": "get average",
"SuccessTransition": "95",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": "",
"IsLVariableGlobal": false,
"IsRVariableGlobal": false,
"IsTargetVariableGlobal": false,
"IsTargetVariableInMemory": false,
"LVariableName": "",
"RValue": {
"Value": 0,
"ValueType": "int"
},
"RVariableName": "",
"Rtype": "var",
"TargetVariableName": "",
"TargetVariableType": "",
"Template": "",
"TransformType": "jpath",
"ValueMapping": [],
"XPathMapping": [
{
"Path": "$.average",
"TargetVariableName": "average",
"TargetVariableType": "int",
"UpdateInputVariable": false
}
]
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": "1",
"nodeName": "value",
"nodeType": "energy"
},
"x": 98,
"y": 407
},
"TypeAlias": "Transform"
},
{
"Id": "95",
"Type": "trigger",
"Label": "",
"SuccessTransition": "96",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:app/rn:energy_guard/ad:1",
"Service": "energy_price",
"ServiceInterface": "evt.energy_price.report",
"Config": {
"InputVariableType": null,
"IsValueFilterEnabled": false,
"LookupServiceNameAndLocation": false,
"PropFilterName": "",
"PropFilterValue": "",
"RegisterAsVirtualService": false,
"Timeout": 0,
"ValueFilter": {
"Value": null,
"ValueType": null
},
"ValueJPath": null,
"ValueJPathResultType": null,
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": "2",
"nodeName": "energy",
"nodeType": "energy"
},
"x": 507,
"y": 146
},
"TypeAlias": "Trigger"
},
{
"Id": "96",
"Type": "transform",
"Label": "get price",
"SuccessTransition": "97",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": "",
"IsLVariableGlobal": false,
"IsRVariableGlobal": false,
"IsTargetVariableGlobal": false,
"IsTargetVariableInMemory": false,
"LVariableName": "",
"RValue": {
"Value": 0,
"ValueType": "int"
},
"RVariableName": "",
"Rtype": "var",
"TargetVariableName": "",
"TargetVariableType": "",
"Template": "",
"TransformType": "jpath",
"ValueMapping": [],
"XPathMapping": [
{
"Path": "$.price",
"TargetVariableName": "price",
"TargetVariableType": "int",
"UpdateInputVariable": false
}
]
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": "3",
"nodeName": "value",
"nodeType": "energy"
},
"x": 501,
"y": 353
},
"TypeAlias": "Transform"
},
{
"Id": "97",
"Type": "wait",
"Label": "Wait 1s for variable",
"SuccessTransition": "98",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": 1000,
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": "4",
"nodeName": "wait",
"nodeType": "energy"
},
"x": 826,
"y": 102
},
"TypeAlias": "Delay"
},
{
"Id": "98",
"Type": "transform",
"Label": "price - (average * 1.0)",
"SuccessTransition": "99",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": "price - (average * 1.0)",
"IsLVariableGlobal": false,
"IsRVariableGlobal": false,
"IsTargetVariableGlobal": false,
"IsTargetVariableInMemory": false,
"LVariableName": "average",
"RValue": {
"Value": 0,
"ValueType": "float"
},
"RVariableName": "",
"Rtype": "var",
"TargetVariableName": "difference",
"TargetVariableType": "float",
"Template": "",
"TransformType": "calc",
"ValueMapping": [],
"XPathMapping": []
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": {
"node_type": "transform_calc",
"threshold": 0
},
"nodeId": "",
"nodeName": "value",
"nodeType": "energy"
},
"x": 782,
"y": 281
},
"TypeAlias": "Transform"
},
{
"Id": "99",
"Type": "if",
"Label": "difference lt 0",
"SuccessTransition": "100",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "difference",
"Operand": "lt",
"RightVariable": {
"Value": 0,
"ValueType": "float"
}
}
],
"FalseTransition": "103",
"TrueTransition": "100"
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": {
"node_type": "if_diff"
},
"nodeId": "",
"nodeName": "If",
"nodeType": "If"
},
"x": 768,
"y": 434
},
"TypeAlias": "If condition"
},
{
"Id": "100",
"Type": "if",
"Label": "og modusen er home, away eller sleep",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "tpflow",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "or",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "home",
"ValueType": "string"
}
},
{
"BooleanOperator": "or",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "away",
"ValueType": "string"
}
},
{
"BooleanOperator": "or",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "sleep",
"ValueType": "string"
}
}
],
"FalseTransition": "",
"TrueTransition": "101"
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": "home,away,sleep",
"nodeName": "If",
"nodeType": "modeTrigger"
},
"x": 752,
"y": 621
},
"TypeAlias": "If condition"
},
{
"Id": "101",
"Type": "action",
"Label": "",
"SuccessTransition": "102",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:flow/ad:1/sv:pz_tts/ad:d4d54080-f61e-11ec-9ba3-dd2b4bfa67f6_0",
"Service": "pz_tts",
"ServiceInterface": "cmd.binary.report",
"Config": {
"DefaultValue": {
"Value": "",
"ValueType": ""
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": true,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 767,
"y": 789
},
"TypeAlias": "Action"
},
{
"Id": "102",
"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": "normal",
"message_no": "normal",
"sender": "flow"
},
"ValueType": "str_map"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "timeline_action",
"x": 925,
"y": 962
},
"TypeAlias": "Timeline"
},
{
"Id": "103",
"Type": "if",
"Label": "",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "difference",
"Operand": "eq",
"RightVariable": {
"Value": 0,
"ValueType": "float"
}
}
],
"FalseTransition": "",
"TrueTransition": "104"
},
"Ui": {
"nodeType": "",
"x": 1017,
"y": 612
},
"TypeAlias": "If condition"
},
{
"Id": "104",
"Type": "if",
"Label": "og modusen er home, away eller sleep",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "tpflow",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "or",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "home",
"ValueType": "string"
}
},
{
"BooleanOperator": "or",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "away",
"ValueType": "string"
}
},
{
"BooleanOperator": "or",
"LeftVariableIsGlobal": true,
"LeftVariableName": "fh.home.mode",
"Operand": "eq",
"RightVariable": {
"Value": "sleep",
"ValueType": "string"
}
}
],
"FalseTransition": "",
"TrueTransition": "101"
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": "home,away,sleep",
"nodeName": "If",
"nodeType": "modeTrigger"
},
"x": 1036,
"y": 775
},
"TypeAlias": "If condition"
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": "parallel"
}