Hello,
I installed the latest Openhabian 3 64-bit onto a new micro SD card yesterday.
The setup worked great and I was able to access the folders via network access and insert my existing files from the working Openhab 2 version.
Unfortunately, I now get the following error messages in the rules for reading the stings of the USB serial connection to the Arduino:
items
String Arduino "Arduino [%s]" (arduino) {serial="/dev/ttyACM0@115200"}
rules
rule "Arduino Lesen"
when
Item Arduino received update or
Item Arduino changed
then
var String ArduinoUpdate = Arduino.state.toString.trim
if (ArduinoUpdate.toString.contains("Buero")) {
var int LichtBueroStartetBei = ArduinoUpdate.indexOf("Licht_Buero,") + "Licht_Buero,".length
var String LichtBuero = ArduinoUpdate.mid(LichtBueroStartetBei, ArduinoUpdate.indexOf(';')-
LichtBueroStartetBei)
if (LichtBuero == "ON" || LichtBuero == "1") {
Buero_Licht_Allgemein_Schalter_HABPANEL.postUpdate(ON)
}else if (LichtBuero == "OFF" || LichtBuero == "0") {
Buero_Licht_Allgemein_Schalter_HABPANEL.postUpdate(OFF)
}
}
=> /var/log/openhab/openhab.log <==
2020-12-31 04:15:08.230 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule
with UID 'Arduino-1' failed: 'mid' is not a member of 'java.lang.String'; line 89, column 33, length 104
in Arduino
2020-12-31 04:15:08.239 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule
with UID 'Arduino-1' failed: 'mid' is not a member of 'java.lang.String'; line 89, column 33, length 104
in Arduino
I have opened and read all kinds of links on the internet and I cannot find the error…
I have already used “Mid” or just “Mid”/“mid” etc.
### Syntax
Mid(string,start[,length])
|Parameter|Description|
string Required. The string expression from which characters are returned|
start Required. Specifies the starting position. If set to greater than the number of
characters in string, it returns an empty string ("")|
length Optional. The number of characters to return|
Thank you very much in advance for your support!
Greetings
Tobi