Where is the error!?!

Hello all.
I have an OpenHab system working but I get an error everytime is called this kind of rules (and I have a lot of them, one for each device), anyhow the function runs. Can you help me?

rule " rec"
   Item  Sala_CPE_send changed 
    var String[] buffer= Sala_CPE_send.state.toString.split(",")  
    if (buffer.get(1).contains("ON"))postUpdate(Sala_CPE, ON )    
    if (buffer.get(1).contains("OFF")) postUpdate(Sala_CPE, OFF )    
    postUpdate(Sala_CPE_Temp,new Double(buffer.get(2)))    

Could you help us out a bit? What is the error?

Try to use Sala_CPE.postUpdate(ON) (Method instead of action)

Is your item definition for Sala_CPE suitable to receive ON or OFF? If the item is a string you should better use Sala_CPE.postUpdate( "ON" )
(The same for your OFF state)

And for Sala_CPE_Temp you should use the method as well…


Back :slight_smile:

The items config is:

Switch Sala_CPE “Luz Candeeiro Pé”
String Sala_CPE_send “send data do UDP” {udp=">[‘REGEX((.*))’]"}
Number Sala_CPE_Temp “Temp. Candeeiro Pé (°C) [%.1f]”

the error taken from the Openhab.log is
2016-10-06 21:19:20.063 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘ rec’: 1

Anyhow the Switch and Number items are well assign in the rule.


Not seen it used with square brackets before, what does that do?

Maybe you should not cut out the error message…
Often the next lines of the log have more (detailed) Information…

What about the method/action change?