Hi all,
I have the following use case:
Monitor the Grid Voltage (in my country we busy going through Load reduction constantly). What I am trying to achieve is the following:
- Grid goes below 200V - Do a bunch of things (turn off some shelly & sonoff switches, notify me via PushOver)
- Grid comes back i.e. over 200V - Do a bunch of things (turn on those switches) notify me via PushOver.
@Steve-Mcl was kind enough to provide a flow which is almost perfect found here
Which is something like this:
[
{
"id": "ba5ec654f3092409",
"type": "mqtt in",
"z": "e0929bd32c7ec00e",
"name": "Grid Voltage",
"topic": "GridMonitor/total/grid_voltage/state",
"qos": "2",
"datatype": "auto",
"broker": "c091ba78eeabbc97",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 310,
"y": 760,
"wires": [
[
"1d79c11acc384f77"
]
]
},
{
"id": "1d79c11acc384f77",
"type": "switch",
"z": "e0929bd32c7ec00e",
"name": "Grid Less than 200",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "200",
"vt": "num"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 550,
"y": 760,
"wires": [
[
"97abddb9929ee05e",
"d363b899dfa329af"
],
[
"58904e116509e8d4",
"5f75c65c0fa9c298"
]
]
},
{
"id": "97abddb9929ee05e",
"type": "debug",
"z": "e0929bd32c7ec00e",
"name": "",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 768,
"y": 696,
"wires": []
},
{
"id": "58904e116509e8d4",
"type": "debug",
"z": "e0929bd32c7ec00e",
"name": "",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 784,
"y": 840,
"wires": []
},
{
"id": "d363b899dfa329af",
"type": "change",
"z": "e0929bd32c7ec00e",
"name": "WARNING. Value is below 200 (Load Reduction)",
"rules": [
{
"t": "set",
"p": "payload_original",
"pt": "msg",
"to": "payload",
"tot": "msg"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "WARNING. Value is below 200",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 890,
"y": 744,
"wires": [
[
"c97c0a2e201a9d74"
]
]
},
{
"id": "5f75c65c0fa9c298",
"type": "change",
"z": "e0929bd32c7ec00e",
"name": "Normal (Above 200)",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Normal (Above 8)",
"tot": "str"
},
{
"t": "set",
"p": "payload_original",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 800,
"y": 800,
"wires": [
[
"c97c0a2e201a9d74"
]
]
},
{
"id": "c97c0a2e201a9d74",
"type": "rbe",
"z": "e0929bd32c7ec00e",
"name": "",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 1210,
"y": 800,
"wires": [
[
"35160fca808147dd"
]
]
},
{
"id": "35160fca808147dd",
"type": "debug",
"z": "e0929bd32c7ec00e",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "msg",
"x": 1490,
"y": 800,
"wires": []
},
]
Which works great for when the grid goes down and comes back up however there is one adjustment which I can't figure out.
When the grid comes back i.e <= 200V I want it to turn on the switches and notify me but then the grid fluctuates between 200V-230V constantly which means it constantly picks up the change and carries on notifying me. I just want that to happen once, when it reaches 200V then stop (Because as long as the grid is above 200V I am good.
So basically IF the grid drops below 200 - DO ABC, IF the grid comes back and stays above 200V DO XYZ