I would recommend calculating the value of your time to fix all the little issues you are having because of a peace of hardware. If you can live with the cost of your time bash away. If not buy a RPi and stand on the shoulders of the openHABian team that have done all the work for the community.
I can live with time cost. At the moment I have only one issue and it’s a java version.
Not sure if armbian is “ready” for openhab with correct java version or I must search how to downgrade under dietpi (or armbian). I tried a sugested instructions but no luck till now.
Let’s go back to my next step. Decode a answer to get relevant data from the answer.
I created rule which will work with received data. Idea is following, take a received string, split char to char and then convert to hex.
var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
var item = itemRegistry.getItem('Received');
var text = item.getState();
val string1 = item.state.split("");
in the terminal I’m looking online on logger information. Problem is to get working a split function. I tried a several instructions, but always a split error.
tested:
val string1 = itemName.state.toString.split("");
String[] arrOfStr = str.split("");
Your input string is binary, not characters…
Break the string into bytes - almost certainly by using getBytes. Have another look at examples already given.
When you say this sort of thing, remember we cannot see what you are doing. What’s a ‘split error’, for example? Show us the logs when relevant.
The code you took the example from is written in DSL syntax.
Looks like you try to run it with the javascript interpreter. Javascript expects a semicolon at end of rows.
That’s DSL rule, written in the original oH1 rules language.
You’ve decided to use javascript, so you can’t just copy/paste, the syntax is different. You don’t declare variables in javascript with val, for example.
I received this :
FFFF1017FFFF1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F1F0000BFAD
FFFF1017FFFF - it’s start information
but next 16x 1F is 16 temperatures for 16 rooms. 1F = 31. To this value is added a constant (for me 5) and then this 16 values I want link to items (room temperature)