Hi there,
I am trying to use the ping component to trigger a GPIO output on my Raspberry PI.
Using the PING component, I want to trigger the output when the device is unreachable, (false)
Then, turn the output off again if the device is reachable.
This will happen for around x20 devices being pinged.
I am using the Toggle option to toggle the GPIO, however I seem to have an issue where I cannot turn the toggle offf when the ping is reporting the response time.
When the ping is unreachable, it returns "false", when the ping is reachable it returns its response time.
The problem is, I cant choose anywhere to turn my toggle off based on "number is <100". I can only seem to set a static number.
Here is my flow, not sure if there is an easier way to do this, but im also trying to use the change function to change the response times from anything <100 to true,
Then setting in the toggle Toggle ON = falase and toggle OFF = true.
But again, I cannot set the value range in the change function for the number <100, only a static number.
Thanks
[
{
"id": "21745817fbfd18be",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "07369c56759dbef9",
"type": "rpi-gpio out",
"z": "21745817fbfd18be",
"name": "",
"pin": "23",
"set": "",
"level": "0",
"freq": "",
"out": "out",
"bcm": true,
"x": 1100,
"y": 240,
"wires": []
},
{
"id": "997431fe224c9b30",
"type": "ping",
"z": "21745817fbfd18be",
"protocol": "IPv4",
"mode": "timed",
"name": "",
"host": "192.168.1.1",
"timer": "5",
"inputs": 0,
"x": 430,
"y": 240,
"wires": [
[
"5daad88e96e03a20",
"41dcfe812b855d0d",
"b654c738e9d99f54"
]
]
},
{
"id": "5daad88e96e03a20",
"type": "change",
"z": "21745817fbfd18be",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "true",
"fromt": "bool",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 660,
"y": 320,
"wires": [
[
"41dcfe812b855d0d"
]
]
},
{
"id": "41dcfe812b855d0d",
"type": "toggle",
"z": "21745817fbfd18be",
"name": "",
"onOffTopic": "",
"onValue": "false",
"onType": "bool",
"offValue": "true",
"offType": "bool",
"toggleTopic": "",
"toggleValue": "",
"toggleType": "str",
"passOnOff": "",
"x": 870,
"y": 240,
"wires": [
[
"07369c56759dbef9"
]
]
},
{
"id": "b654c738e9d99f54",
"type": "debug",
"z": "21745817fbfd18be",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 700,
"y": 140,
"wires": []
}
]