I am in despair. I have a 4-way switch (NETIO-230) that can only be integrated with the HTTP binding.
In principle, this also works. I can operate every switch, but I don’t get any for the individual switch
separate feedback, since the status for all 4 switches is given as a string in the form 0 0 1 1.
(0=ON, 1=OFF).
Through an XPath stateTransformation I can isolate the state in the form “0 0 1 1” and use as a string in a
rules. But that’s a little cumbersome.
I want a REGEX transform for each switch state. Through the expression (0-1) I get
(Test on https://regex101.com/) e.g. the status of the 3rd switch (from the left) from 1 0 1 1 as
String 0 or 1 isolated but get no result when I use this expression in channel or item settings
from OH3 V3.2.0 use.
The transform is installed. For example, with the expression (.*) I get the complete status string 0 0 1 1 displayed.
Who is specialist in REGEX with http binding and can help me.
It would be ideal if I had an ON/OFF value for each switch to use in the switch channels. The isolation as string 0/1 would be a first step for further processing with MAP transformation.
My http-Thing Definition
Thing http:url:netio230 "_NETIO-230" [
baseURL="http://192.168.31.3/tgi/control.tgi?login=p:user:xxx",
authMode = "BASIC",
commandMethod = "GET",
ignoreSSLErrors = true,
bufferSize = "2048",
timeout = "3000",
refresh=10 ]
{
Channels:
Type switch : netio0 "Schalter1" [
commandExtension = "&port=%2$s",
stateExtension = "&port=list",
onValue= "1uuu", offValue = "0uuu",
mode="WRITEONLY"
]
Type switch : netio1 "Schalter2" [
commandExtension ="&port=%2$s",
stateExtension = "&port=list",
onValue= "u1uu", offValue = "u0uu",
mode="WRITEONLY"
]
Type switch : netio2 "Schalter3" [
commandExtension = "&port=%2$s",
stateExtension = "&port=list",
onValue= "uu1u", offValue = "uu0u",
mode="WRITEONLY"
]
Type switch : netio3 "Schalter4" [
commandExtension = "&port=%2$s",
stateExtension = "&port=list",
onValue= "uuu1", offValue = "uuu0",
mode="WRITEONLY"
]
Type string : netiostat "NETIO-Status" [
stateExtension = "&port=list",
stateTransformation = "XPath:/html/text()",
mode="READONLY"
]
}