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
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…
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.