I am still wondering how I can get it to work. I’ve absolutely no knowledge about compiling the java source
So junit seems to be a java framework for tests, it is also hosted on github (see here for version 4.10 which is required by the smarthomatic binding).
I found it in the file MANIFEST.MF line 15, in file TestSHCMessage.java line 11, 19 & 20 and in file TestSHCMessageGenereation.java in line 11, 15 & 16.
For me it looks that these parts are only there to test that the interpreter for smarthomatic messages works correctly. Is it mandatory for the function of the binding? But to be honest I do not understand how the code works.
Can anybody with more java knowledge than me look through and provide me a solution, please?
catches the decoded message from my base station. And an item definition like
Number SH2_Temp "Temp. Sensor2 [%.1f °C]" (gTemp) { serial="/dev/ttyUSB0@19200,REGEX(SenderID=2;.+Temperature=([0-9.]+))" }
captures the temperature value from this string. All items are updated the same time if the value is part of the same message. Very nice! Unfortunately some messages are not fully decoded and I get the message data as byte series. In this case the message data is a hex string that has to be decoded according the message cataloge of smarthomatic.
How do I transform a hex strings first 7 bit to a number?
e.g.: (hex=BA00… > bin=1011101000000000… > first7bit=1011101 > dec=93)
Or bit 8 and the following two bytes?
Can I use a transform script in the item definition, but how to combine regex and transform?