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?
Thanks

rule "192.168.1.201 rec"
when 
   Item  Sala_CPE_send changed 
then
    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)))    
end

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…

Andreas

Back :slight_smile:

The items config is:

Switch Sala_CPE “Luz Candeeiro Pé”
String Sala_CPE_send “send data do UDP” {udp=">[192.168.1.201:5000:‘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 ‘192.168.1.202 rec’: 1

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

.Thanks

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?