Author Topic: Trig a motion sensor from a scene?  (Read 344 times)

Offline clausnilsson

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Trig a motion sensor from a scene?
« on: July 19, 2017, 08:08:50 pm »

In a room with a motion sensor and door sensors I have this challenge. Light goes on when a door opens or when motion is detected. I want the light to go off when no movement has been detected for 5 minutes. I figured out how to program the motion sensor to send an off command 5 minutes after last movement detection. So far so good.

However, this only works if the motion sensor does detect motion. Frequently we go through the room without triggering the motion sensor despite the central position of the sensor.

But the light does turn on because of the door sensors. However I cannot set a timer to switch off the light after 5 minutes as it will switch it off even if there has been motion detected 2 seconds ago.

The solutions should be to let a script let a door sensor trig the motion sensor, so that the motion sensor thinks it detects motion when a door sensor tells it to. But the only action I can do on a motion sensor in a script is to arm or disarm, which is no help.

So what do I do?


Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10091
  • Karma: +763/-142
Re: Trig a motion sensor from a scene?
« Reply #1 on: July 20, 2017, 08:19:21 am »
Or look into using PLEG for your logic ... either can turn on the light and (re-) trigger a timer ... and the end of the timer can turn off the light.

Offline sebby

  • Full Member
  • ***
  • Posts: 221
  • Karma: +8/-3
Re: Trig a motion sensor from a scene?
« Reply #2 on: July 20, 2017, 09:58:02 am »
maybe a simple variable_set on the luup code of your scene:

luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", "1", DEV_ID)

you are also going to have to untrip it after...
« Last Edit: July 20, 2017, 09:59:41 am by sebby »