Hello,
I am somewhat new to OpenHAB - while I already use OpenHAB with my KNX Installation on my iPhone basically only as a remote - I now would like to go one step further into the “automation” of things.
Unfortunately when building my house I used the “Internorm Smart Window” Solution to capture the state of my windows (Open, Closed, Tilted). This solution is basically a modified Mediola Gateway V4.
Now I would like to make these window states also available in OpenHAB in order to automate my shutters. (e.g. When a window is open and it starts to rain then the shutter shall close, … )
I already was able to read out the statuses via a http call that looks like follows:
This will result in the following html feedback:
{XC_SUC}[{“type”:“IW”,“adr”:“FF”,“state”:“0018:00”},{“type”:“IW”,“adr”:“01366B01”,“state”:“0110:01”},{“type”:“IW”,“adr”:“01366B02”,“state”:“0012:05”},{“type”:“IW”,“adr”:“01366B03”,“state”:“0012:07”},{“type”:“IW”,“adr”:“01366B04”,“state”:“081A:FF”},{“type”:“IW”,“adr”:“01366B05”,“state”:“0012:07”},{“type”:“IW”,“adr”:“01366B06”,“state”:“0012:04”},{“type”:“IW”,“adr”:“01366B07”,“state”:“081A:FF”},{“type”:“IW”,“adr”:“01366B08”,“state”:“0112:02”},{“type”:“IW”,“adr”:“01366B09”,“state”:“0012:02”},{“type”:“IW”,“adr”:“01366B10”,“state”:“081A:FF”},{“type”:“IW”,“adr”:“01366B11”,“state”:“0012:02”},{“type”:“IW”,“adr”:“01366B12”,“state”:“081A:FF”},{“type”:“IW”,“adr”:“01366B13”,“state”:“0012:04”},{“type”:“IW”,“adr”:“01366B14”,“state”:“0112:01”},{“type”:“IW”,“adr”:“01366B15”,“state”:“0012:01”},{“type”:“IW”,“adr”:“01366B16”,“state”:“0012:01”},{“type”:“IW”,“adr”:“01366B17”,“state”:“0012:01”},{“type”:“IW”,“adr”:“01366B18”,“state”:“0012:02”},{“type”:“IW”,“adr”:“01366B19”,“state”:“0112:01”},{“type”:“IW”,“adr”:“01366B20”,“state”:“081A:FF”},{“type”:“IW”,“adr”:“01366B21”,“state”:“0112:01”}]
The syntax is that:
- the “adr” is the Adress of a window (e.g. 01366B02 = Bathroom Window)
- the 3rd and 4th digit of the state is the state of the window (12=closed, 10=open, 11=tilted)
Now - my Problem is that I do not know how to extract the status of each window and make it usable in OpenHab for further processing / logic.
I tried to use RegEx, but not very successful - I was able to find the state of a adress with the following RegEx - but I do not really know how to make use of it:
/adr":“01366B02”.?state":"(.?):/si
Since I do know which window I am adressing I would only need the status back.
Guess this is a very basic question - guess I am only missing that little hint…
thanks in advance