Status,g,<gpio>
Posted: 26 Jul 2023, 13:42
Hi there, I´m unable to find a solution in this Forum nor the web......
According to the commandref "Status,g,<gpio>" gives you the status of the respetive GPIO.
Unfortunately it is a whole bunch of text, e.g.
{
"log": "",
"plugin": 1,
"pin": 12,
"mode": "output",
"state": 0
}
I only need the "1" or "0" to decide further actions....
My DeviceList is full with 12 devices so I cannot configure it there to get a simple 1 or 0.
Is there any formatting possible that I can use it in the rules?
For example like this:
if (status,g,12) = 1
event,do_something
else
event,do_somethingelse
endif
Thanks for your help!
According to the commandref "Status,g,<gpio>" gives you the status of the respetive GPIO.
Unfortunately it is a whole bunch of text, e.g.
{
"log": "",
"plugin": 1,
"pin": 12,
"mode": "output",
"state": 0
}
I only need the "1" or "0" to decide further actions....
My DeviceList is full with 12 devices so I cannot configure it there to get a simple 1 or 0.
Is there any formatting possible that I can use it in the rules?
For example like this:
if (status,g,12) = 1
event,do_something
else
event,do_somethingelse
endif
Thanks for your help!