device/MotionSensor

class aaa_modules.layout_model.motion_sensor.MotionSensor(switchItem)[source]

Represents a motion sensor; the underlying OpenHab object is a SwitchItem.

__init__(switchItem)[source]
Parameters:switchItem (org.eclipse.smarthome.core.library.items.SwitchItem) –
Raises:ValueError – if any parameter is invalid
isOccupied(minutesFromLastMotionEvent=5)[source]

Returns true if a motion event was triggered within the provided # of minutes. Returns false otherwise.

Return type:bool
isOn()[source]

Returns true if the motion sensor’s state is on; false otherwise.

onMotionSensorTurnedOn(events, itemName)[source]

Handled the motion sensor ON event.

Return type:True if itemName matches this sensor; False otherwise.