I want to use template below to check my Garage Door sensor:
local status = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, dID)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, dID)
I have the following values on the device properties’ screen:
name Garage Door Sensor
Device #70
ID 65
device_type: urn:schemas-micasaverde-com:device:MotionSensor:1
device_file D_MotionSensor1.xml
How I can check sensor status and send email is door is still open at 10:00 pm?
Thanks in advance!
Santos
2
If you go into Apps / Develop Apps / Luup Files and open the D_MotionSensor1.XML file you will see this:
<root>
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-micasaverde-com:device:MotionSensor:1</deviceType>
<staticJson>D_MotionSensor1.json</staticJson>
<serviceList>
<service>
<serviceType>urn:schemas-micasaverde-com:service:SecuritySensor:1</serviceType>
<serviceId>urn:micasaverde-com:serviceId:SecuritySensor1</serviceId>
<SCPDURL>S_SecuritySensor1.xml</SCPDURL>
</service>
<service>
<serviceType>urn:schemas-micasaverde-com:service:HaDevice:1</serviceType>
<serviceId>urn:micasaverde-com:serviceId:HaDevice1</serviceId>
<SCPDURL>S_HaDevice1.xml</SCPDURL>
</service>
</serviceList>
</device>
</root>
I believe what you’re looking for is “urn:micasaverde-com:serviceId:SecuritySensor1”
You can find the Service ID for ANY variable in Vera from the UI by following the following steps:
- Find the Device of Interest on the Control Panel.
- Goto the Advanced Tab … You will find the Device ID there.
- Find the variable for the device … You now have the Variable Name
- Hover the mouse over the Variable name … It will show you the ServiceID for that Variable for that Device!
Or, indeed on this handy web page which lets you drill down into the device you need
VeraIP:3480/data_request?id=invoke
[quote=“akbooer, post:4, topic:190597”]Or, indeed on this handy web page which lets you drill down into the device you need
VeraIP:3480/data_request?id=invoke
[/quote]
Thanks, akbooer!
Never knew that, and you don’t know how many times I’ve tried (and failed) to copy/paste from a “hover”.