I upgraded from 2.5 to OH 3 Milestone build 4 -> then to 5.
Probably should have done more reading but I was so excited after watching the presentation on OH3 that I couldn’t resist. One of the issues I am having is with the getEvent() in a rule not working. “This is a new rule I am testing out after the upgrade”
rule "Turn off all lights without separator"
when
Channel "xmppclient:xmppBridge:xmpp:xmpp_command" triggered
then
var actionName = receivedEvent.getEvent()
if(actionName.toLowerCase() == "turn off lights") {
MasterRecessed_Dimmer.sendCommand(OFF)
}
end
VSS is showing
method getEvent() is undefined for type String
Google doesn’t seem to be much help on this. Except for this one post that looks like my problem but it seems as if nothing was figured out. https://github.com/openhab/openhab-core/issues/706.
and I am not sure if it’s related but I am also getting this. These below I had running with no issues prior to the upgrade.
// There is probably a more elegant way to do this but it does what I need …
rule "Temp Cool"
when
Item AC_Cool_It received command ON
then
Thermostat_SetpointCooling.sendCommand(73)
AC_Switch_Timer = createTimer(now.plusMillis(ACSwitchDelay)) [|
AC_Switch_Timer.cancel
AC_Switch_Timer = null
]
AC_2hr_Timer = createTimer(now.plusMillis(AC_Time_2_Milisec)) [|
Thermostat_SetpointCooling.sendCommand(75)
AC_2hr_Timer.cancel
AC_2hr_Timer = null
sendCommand(AC_Cool_It, OFF)
]
end