Intro
You can create automations through Thingsplex flows to control devices based on how much your Fronius Inverter produces, or similar.
To access Thingsplex, please follow the Thingsplex guide.
If you make a flow that works well for you, and you want to share it with the rest of the Futurehome community, please do so in forum.futurehome.io.
Automation example
As an example, we have created an automation to publish an event in the timeline if the Fronius Inverter produces more than 3000W.
The source code is available at the bottom of this document. To make this flow work with your speakers, follow these steps:
- Copy the source code at the bottom of this document.
- Click on «import» in flows and paste the source code provided.
- Click on the if condition node. Under value, you can change the value of which you want the flow to differentiate. In the source code below it is set to 3000 W.
- Change the action nodes (timeline in the example) to do what you want the flow to do. For example, make a generic action node that turns on your water heater.
- Save.
List of supported interfaces: https://github.com/thingsplex/fronius
Source code
-
{
"Id": "jDtHzGOzAcwrXsx",
"ClassId": "jDtHzGOzAcwrXsx",
"Author": "",
"Version": 0,
"CreatedAt": "2020-11-19T12:16:41.016268639+01:00",
"UpdatedAt": "2020-11-19T12:28:53.268387556+01:00",
"Name": "fronius test",
"Group": "fronius",
"Description": "fronius",
"Nodes": [
{
"Id": "1",
"Type": "trigger",
"Label": "trigger",
"SuccessTransition": "2",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:fronius/ad:1/sv:meter_elec/ad:1",
"Service": "meter_elec",
"ServiceInterface": "evt.meter_ext.report",
"Config": {
"InputVariableType": "",
"IsValueFilterEnabled": false,
"LookupServiceNameAndLocation": false,
"PropFilterName": "",
"PropFilterValue": "",
"RegisterAsVirtualService": false,
"Timeout": 0,
"ValueFilter": {
"Value": null,
"ValueType": "float_map"
},
"ValueJPath": "",
"ValueJPathResultType": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": null
},
"Ui": {
"nodeType": "",
"x": 62,
"y": 230
},
"TypeAlias": "Trigger"
},
{
"Id": "2",
"Type": "transform",
"Label": "get_p_export",
"SuccessTransition": "4",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": "",
"IsRVariableGlobal": false,
"IsTargetVariableGlobal": false,
"IsTargetVariableInMemory": true,
"LVariableName": "",
"RValue": {
"Value": 0,
"ValueType": "int"
},
"RVariableName": "",
"Rtype": "var",
"TargetVariableName": "",
"TargetVariableType": "",
"Template": "",
"TransformType": "jpath",
"ValueMapping": [],
"XPathMapping": [
{
"IsTargetVariableGlobal": true,
"Path": "$.val.p_export",
"TargetVariableName": "p_export",
"TargetVariableType": "float",
"UpdateInputVariable": false
}
]
},
"Ui": {
"nodeType": "",
"x": 62,
"y": 373
},
"TypeAlias": "Transform"
},
{
"Id": "4",
"Type": "if",
"Label": "if_>_3000",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "",
"Service": "",
"ServiceInterface": "",
"Config": {
"Expression": [
{
"BooleanOperator": "",
"LeftVariableIsGlobal": true,
"LeftVariableName": "p_export",
"Operand": "gt",
"RightVariable": {
"Value": 3000,
"ValueType": "float"
}
}
],
"FalseTransition": "6",
"TrueTransition": "5"
},
"Ui": {
"nodeType": "",
"x": 59,
"y": 519
},
"TypeAlias": "If condition"
},
{
"Id": "5",
"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": "fronius >1000",
"message_no": "-",
"sender": "flow"
},
"ValueType": "str_map"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "timeline_action",
"x": 18,
"y": 683
},
"TypeAlias": "Timeline"
},
{
"Id": "6",
"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": "fronius <1000",
"message_no": "-",
"sender": "flow"
},
"ValueType": "str_map"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "timeline_action",
"x": 238,
"y": 684
},
"TypeAlias": "Timeline"
}
],
"Settings": null,
"IsDisabled": true,
"IsDefault": false,
"ParallelExecution": "parallel"
}
Comments
0 comments
Please sign in to leave a comment.