Hi,
I’ve been having an issue with rules for Xiaomi button and cube events since upgrading to OH 2.4. It worked fine with test releases (Milestones 1,3, 7 and 8) but since the final release I’ve been getting
[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Xiaomi Cube’: ‘getEvent’ is not a member of ‘org.eclipse.smarthome.core.thing.events.ChannelTriggeredEvent’; line 166, column 22, length 24
The same goes for button events
[ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Xiaomi Switch Button’: ‘getEvent’ is not a member of ‘org.eclipse.smarthome.core.thing.events.ChannelTriggeredEvent’; line 248, column 22, length 24
The rules have been running fine up until then so I don’t think it’s the rules.
rule “Xiaomi Switch Button”
when
Channel ‘mihome:sensor_switch_aq2:xxx:xxx:button’ triggered
then
var actionName = receivedEvent.getEvent()
//logInfo(“Xiaomi Button”, actionName)
switch(actionName)
{
case “SHORT_PRESSED”: {
logInfo(“Xiaomi Button”, actionName)
}
case “DOUBLE_PRESSED”: {
logInfo(“Xiaomi Button”, actionName)
if (Light_Bedroom_Sw.state!=ON) // item OFF or uninitialized
Light_Bedroom_Sw.sendCommand(ON)
else
Light_Bedroom_Sw.sendCommand(OFF)
}
}
end