Motion sensor to trigger a scene?

Hi,
I’ve been searching for triggering a scene when a motion sensor is tripped.
It sounds as a very easy task but I can’t find any information. May someone please advice me how to do?

I came across this code that I’ve put in a scene:

[code]local sIsTripped1=luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”,“Tripped”,5)

if (sIsTripped1==“1”) then
luup.inet.wget(“https://prowl.weks.net/publicapi/add?apikey=private&application=Vera&event=testaaa2”)
return false
end
[/code]
Which will send me a notification if motion sensor is tripped. But as of now this only work when I press run scene and the motion sensor is tripped which is kinda useless. I want the tripped sensor to trigger the wget command.

How much digging have you done on the Events tab of the scene? Have you tried to add an event?

Edit: For those finding this thread later on while searching, apparently UI5 will call Events “Triggers”.

Thanks! I knew it would be this easy :slight_smile:

FYI, you can set up multiple events in one scene. These are OR triggers, in that ANY of the events in a scene will trigger it.

In order to do an AND conditional where multiple things happen or are in a certain state, you’ll need to apply luup code. Example, motion ON and it’s night. All doors closed. And so on.

The event GUI only handle OR situations.

Ok, thanks for the information!

Does anyone know how I can create a device that keeps variables that are changable from luup?

I’ve tried to create a device Description: "System"and left all other fields empty.
Then I created a Variable: Service: “SystemDevice1”, variable: “Mode”, value: “out”

And I am trying to change this variable from luup code with no great success:
luup.variable_set(“SystemDevice1”, “Mode”, “home”, 28)

What am I doing wrong here?