Hello
Using ESP32 with Tasmota and NodeRed software, I want to control 3 heaters (2kV - domestic hot water, 4.2kV and 6kV - heating the house in winter). I also have a photovoltaic installation with a Fronius inverter. Device via API I can ask about current production. I live in Poland and the price of electricity depends on the time of day. I check the cheap price using my JS function available on NPM cheap-electricity-tariff - npm
I would like to maximize the production of electricity from the PV installation and turn on one or several heaters depending on the amount of production.
Scenarios:
- small production and expensive electricity tariff - heaters turned off
- PV production 8kVh - 6kV or 2kV and 4.2kV heater on
- PV production 3kV - 2kV heater turned on
- small production and cheap tariff, all heaters on (in winter, 2kV only in summer)
- e.t.c ...
I know how to download data from PV and cheap electricity tariff separately, but how to connect it? PV data is asynhronic. Electricity price data calculated locally on Synology NAS running NodeRed
[
{
"id": "db1af05c8e10d423",
"type": "inject",
"z": "620fe87e26a122f7",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Cheap tariff winter",
"payloadType": "str",
"x": 160,
"y": 660,
"wires": [
[
"3258b0e2cda8ba1e"
]
]
},
{
"id": "d89fab58f598f5e0",
"type": "debug",
"z": "620fe87e26a122f7",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 590,
"y": 740,
"wires": []
},
{
"id": "efff1d3429cdfc91",
"type": "http request",
"z": "620fe87e26a122f7",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://fotowoltaikaapi.wachcio.pl/inverter-realtime-data/common-inverter-data",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": true,
"x": 290,
"y": 500,
"wires": [
[
"f3f9ad6281a8ef15"
]
]
},
{
"id": "ca76e1ffeec4db82",
"type": "debug",
"z": "620fe87e26a122f7",
"name": "Fronius",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 840,
"y": 500,
"wires": []
},
{
"id": "f9c179e6c0dcc08c",
"type": "inject",
"z": "620fe87e26a122f7",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 120,
"y": 500,
"wires": [
[
"efff1d3429cdfc91"
]
]
},
{
"id": "f3f9ad6281a8ef15",
"type": "json",
"z": "620fe87e26a122f7",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 450,
"y": 500,
"wires": [
[
"4fe070fd15b99bf1"
]
]
},
{
"id": "4fe070fd15b99bf1",
"type": "function",
"z": "620fe87e26a122f7",
"name": "Check PV prodution",
"func": "return {PAC:msg.payload.Body?.Data?.PAC?.Value ?? 0};",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 640,
"y": 500,
"wires": [
[
"ca76e1ffeec4db82"
]
]
},
{
"id": "3258b0e2cda8ba1e",
"type": "function",
"z": "620fe87e26a122f7",
"name": "Is cheap tariff?",
"func": "const isCheap = global.get('isCheapTariff')\nconst onOff = isCheap.isCheapTariff() ? 'ON' : 'OFF'\nreturn {payload:onOff, message:`Cheap tariff. Heating ${onOff}`};",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 660,
"wires": [
[
"0f1a557865989965",
"e9206c9cb09141dd",
"c50f76599d184b68",
"d89fab58f598f5e0"
]
]
},
{
"id": "0f1a557865989965",
"type": "mqtt out",
"z": "620fe87e26a122f7",
"name": "Heater 6kV",
"topic": "cmnd/kotlownia/POWER1",
"qos": "1",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "e867dbc3.269d78",
"x": 610,
"y": 560,
"wires": []
},
{
"id": "e9206c9cb09141dd",
"type": "mqtt out",
"z": "620fe87e26a122f7",
"name": "Heater 4_2kV",
"topic": "cmnd/kotlownia/POWER2",
"qos": "1",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "e867dbc3.269d78",
"x": 620,
"y": 620,
"wires": []
},
{
"id": "c50f76599d184b68",
"type": "mqtt out",
"z": "620fe87e26a122f7",
"name": "Heater 2kV",
"topic": "cmnd/kotlownia/POWER3",
"qos": "1",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "e867dbc3.269d78",
"x": 610,
"y": 680,
"wires": []
},
{
"id": "e867dbc3.269d78",
"type": "mqtt-broker",
"name": "NAS MQTT server",
"broker": "192.168.2.2",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"sessionExpiry": ""
}
]