Her er 4-delt strømprisregler:
{
"Id": "30f134b0-2c60-11ed-9c5d-d7b3b0b26935",
"ClassId": "30f134b0-2c60-11ed-9c5d-d7b3b0b26935",
"Author": "groodal1@gmail.com",
"Version": 0,
"CreatedAt": "2022-09-04T14:45:16.79576Z",
"UpdatedAt": "2022-10-07T21:29:19.359918726+02:00",
"Name": "Regler Strømpris",
"Group": "energy_price",
"Description": "4-delt strømprisordning",
"Nodes": [
{
"Id": "fea5758d-41d2-4a73-b971-416023ab7da3",
"Type": "trigger",
"Label": "4-delt strømprisordning",
"SuccessTransition": "1",
"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": 100,
"y": 200
},
"TypeAlias": "Trigger"
},
{
"Id": "1",
"Type": "transform",
"Label": "get average",
"SuccessTransition": "",
"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": null,
"nodeName": "value",
"nodeType": "energy"
},
"x": 100,
"y": 382
},
"TypeAlias": "Transform"
},
{
"Id": "2",
"Type": "trigger",
"Label": "",
"SuccessTransition": "3",
"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": 414,
"y": 199
},
"TypeAlias": "Trigger"
},
{
"Id": "3",
"Type": "transform",
"Label": "get price",
"SuccessTransition": "4",
"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": null,
"nodeName": "value",
"nodeType": "energy"
},
"x": 416,
"y": 398
},
"TypeAlias": "Transform"
},
{
"Id": "4",
"Type": "wait",
"Label": "Wait 1s for variable",
"SuccessTransition": "35",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": 1000,
"Ui": {
"nodeType": "",
"papp": {
"customValues": null,
"nodeId": null,
"nodeName": "wait",
"nodeType": "energy"
},
"x": 325,
"y": 637
},
"TypeAlias": "Delay"
},
{
"Id": "28",
"Type": "if",
"Label": "difference gt 0",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "difference",
"Operand": "gt",
"RightVariable": {
"Value": 0,
"ValueType": "float"
}
}
],
"FalseTransition": "34",
"TrueTransition": "48"
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": {
"flow_part": "main",
"node_type": "if_diff"
},
"nodeId": null,
"nodeName": "If",
"nodeType": "If"
},
"x": 497,
"y": 1087
},
"TypeAlias": "If condition"
},
{
"Id": "30",
"Type": "if",
"Label": "difference gt 0",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "difference",
"Operand": "lt",
"RightVariable": {
"Value": 0,
"ValueType": "float"
}
}
],
"FalseTransition": "49",
"TrueTransition": "45"
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": {
"flow_part": "main",
"node_type": "if_diff"
},
"nodeId": null,
"nodeName": "If",
"nodeType": "If"
},
"x": 792,
"y": 1116
},
"TypeAlias": "If condition"
},
{
"Id": "31",
"Type": "if",
"Label": "difference gt 0",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": false,
"LeftVariableName": "difference",
"Operand": "gt",
"RightVariable": {
"Value": 0,
"ValueType": "float"
}
}
],
"FalseTransition": "36",
"TrueTransition": "47"
},
"Ui": {
"nodeType": "",
"papp": {
"customValues": {
"flow_part": "main",
"node_type": "if_diff"
},
"nodeId": null,
"nodeName": "If",
"nodeType": "If"
},
"x": 216,
"y": 1062
},
"TypeAlias": "If condition"
},
{
"Id": "34",
"Type": "transform",
"Label": "price - (average * 0.5)",
"SuccessTransition": "30",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": "price - (average * 0.5)",
"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": {
"flow_part": "main",
"node_type": "transform_calc",
"threshold": 1
},
"nodeId": null,
"nodeName": "value",
"nodeType": "energy"
},
"x": 789,
"y": 848
},
"TypeAlias": "Transform"
},
{
"Id": "35",
"Type": "transform",
"Label": "price - (average * 2.0)",
"SuccessTransition": "31",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": "price - (average * 2.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": {
"flow_part": "main",
"node_type": "transform_calc",
"threshold": 1
},
"nodeId": null,
"nodeName": "value",
"nodeType": "energy"
},
"x": 220,
"y": 896
},
"TypeAlias": "Transform"
},
{
"Id": "36",
"Type": "transform",
"Label": "price - (average * 1.5)",
"SuccessTransition": "28",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": "price - (average * 1.5)",
"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": {
"flow_part": "main",
"node_type": "transform_calc",
"threshold": 1
},
"nodeId": null,
"nodeName": "value",
"nodeType": "energy"
},
"x": 502,
"y": 869
},
"TypeAlias": "Transform"
},
{
"Id": "45",
"Type": "set_variable",
"Label": "Strømpris Billig",
"SuccessTransition": "51",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"DefaultValue": {
"Value": "1",
"ValueType": "string"
},
"IsVariableInMemory": true,
"Name": "fh.strømpris",
"UpdateGlobal": true,
"UpdateInputMsg": false
},
"Ui": {
"nodeType": "",
"x": 1090,
"y": 1313
},
"TypeAlias": "Set variable"
},
{
"Id": "47",
"Type": "set_variable",
"Label": "Strømpris Peak",
"SuccessTransition": "50",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"DefaultValue": {
"Value": "4",
"ValueType": "string"
},
"IsVariableInMemory": true,
"Name": "Strømpris",
"UpdateGlobal": true,
"UpdateInputMsg": false
},
"Ui": {
"nodeType": "",
"x": 221,
"y": 1318
},
"TypeAlias": "Set variable"
},
{
"Id": "48",
"Type": "set_variable",
"Label": "Strømpris Høy",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"DefaultValue": {
"Value": "3",
"ValueType": "string"
},
"IsVariableInMemory": true,
"Name": "Strømpris",
"UpdateGlobal": true,
"UpdateInputMsg": false
},
"Ui": {
"nodeType": "",
"x": 506,
"y": 1318
},
"TypeAlias": "Set variable"
},
{
"Id": "49",
"Type": "set_variable",
"Label": "Strømpris Normal",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"DefaultValue": {
"Value": "2",
"ValueType": "string"
},
"IsVariableInMemory": true,
"Name": "Strømpris",
"UpdateGlobal": true,
"UpdateInputMsg": false
},
"Ui": {
"nodeType": "",
"x": 816,
"y": 1317
},
"TypeAlias": "Set variable"
},
{
"Id": "50",
"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": "Energy price is now very high",
"message_no": "Strømprisen er nå veldig høy",
"sender": "flow"
},
"ValueType": "str_map"
},
"IsVariableGlobal": true,
"Props": {},
"RegisterAsVirtualService": false,
"VariableName": "fh.strømpris",
"VariableType": "string",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "timeline_action",
"x": 219,
"y": 1510
},
"TypeAlias": "Timeline"
},
{
"Id": "51",
"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": "Energy price is low",
"message_no": "Strømprisen er nå lav",
"sender": "flow"
},
"ValueType": "str_map"
},
"IsVariableGlobal": true,
"Props": {},
"RegisterAsVirtualService": false,
"VariableName": "fh.strømpris",
"VariableType": "string",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "timeline_action",
"x": 1097,
"y": 1497
},
"TypeAlias": "Timeline"
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": "parallel"
}