Here is an additional rule which monitors the roombaPhase and keeps other Roomba states correctly set. Without this, if the Roomba cleaning job was started manually (i.e. the clean button on the vacuum) then my active phone call rule would not trigger…
rule "Update various Roomba switches based on roombaPhase state"
when
Item roombaPhase received update
then
if (roombaPhase == 'run') {
roombaActive.postUpdate(ON)
roombaDock.postUpdate(OFF)
}
if (roombaPhase == 'charge') {
roombaDock.postUpdate(ON)
}
if (roombaPhase == 'none') {
roombaActive.postUpdate(OFF)
roombaDock.postUpdate(ON)
roombaPause.postUpdate(OFF)
}
end