val String filename = "Roborock.rules"
rule "Roborock alexa"
when
Item VacAlexa received command
then
switch VacAlexa.state.toString{
case "ON":{
actionControl.sendCommand("vacuum")
logInfo(filename,"Staubsauger wurde eingeschalten")
}
case "OFF":{
actionControl.sendCommand("dock")
logInfo(filename,"Staubsauger wurde ausgeschalten")
}
}
end
logs:
2019-01-07 15:53:08.204 [ome.event.ItemCommandEvent] - Item 'VacAlexa' received command ON
2019-01-07 15:53:08.233 [nt.ItemStatePredictedEvent] - VacAlexa predicted to become NULL
rules not getting fired, where does the āPredictionā in the logs come from?
@kai wrote about this a while back ā canāt lay hands on the reference at the moment. Essentially, the result of a new āfeatureā in core OH. Causes grief specifically to me also specifically because rules donāt fire. The hack around it is to use the phrase
... , autoupdate="false" ....}
in the channel descriptor for the real item. Adding that to the real item seems to make derived-virtual-item targetted rules fire as expected.
val String filename = "Roborock.rules"
rule "Roborock alexa"
when
Item VacAlexa received command
then
switch receivedCommand {
case ON:{
actionControl.sendCommand("vacuum")
logInfo(filename,"Staubsauger wurde eingeschalten")
}
case OFF:{
actionControl.sendCommand("dock")
logInfo(filename,"Staubsauger wurde ausgeschalten")
}
}
end