milo
(M)
June 14, 2019, 8:26am
1
hello,
i like to read this csv file
alarm,test
1,0
here is my rule
rule "5min"
when
Time cron "0 0/1 * * * ?"
then
val setpoint = executeCommandLine("cat openhab.config", 1000).split(",").get(1)
logInfo("5min is", setpoint.toString())
end
with get(1) I get
test
1
how do I get the “1” alone???
Thanks
milo
(M)
June 14, 2019, 9:10am
2
solved by
executeCommandLine("cat openhab.config", 1000).split("\n").get(1).split(",").get(0)
1 Like
milo
(M)
July 21, 2019, 3:09pm
3
can somebody help me with this error??
var string_localsusvbatterycapacity = executeCommandLine("/bin/sh@@-c@@(sed -ne 's/.*capacity.* \([0-9.][0-9.]*\)%.*/\1/p' /etc/openhab2/services/susv.status)", 5000)
error
Configuration model 'system.rules' has errors, therefore ignoring it: [12,100]: Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )