We have moved at community.getvera.com

Author Topic: Problem with Everspring WIindows sensor and LUUP code - service id  (Read 3890 times)

Offline weissertigerxl

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +1/-0
Problem with Everspring WIindows sensor and LUUP code - service id
« on: September 07, 2011, 08:41:52 am »

What is wrong?

The Eversping is shown as MotionSensor. The last code I tried was:


local sIsTripped1=luup.variable_get("urn:upnp-org:serviceId:MotionSensor1","Tripped",4)
 local sIsTripped2=luup.variable_get("urn:upnp-org:serviceId:MotionSensor1","Tripped",3)

if (( sIsTripped1=="1" ) or ( sIsTripped2=="1" )) then
-- Inform me when the alarm system is armed.
   luup.inet.wget("https://prowl.weks.net/publicapi/add?apikey=Edited for privacy =1")
   return false
end

Thanks for HELP!

Stefan
« Last Edit: September 08, 2011, 11:16:00 am by JOD »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #1 on: September 08, 2011, 01:41:44 am »
(You probably want to obscure your Prowl API key in that message, unless you want random people sending you notifications.)

"urn:upnp-org:serviceId:MotionSensor1" is probably wrong.  I'm sure you tried "urn:micasaverde-com:serviceId:SecuritySensor1", but go back to that one, it's much more likely to be correct.  Copy and paste it to be sure you spell it correctly; I copied straight from Vera into this post so I know it's right.

I have to take on faith that your device IDs are correct.  They are the number that appears next to "Device #" when you look at the device's Advanced tab.  The Z-Wave device number isn't necessarily the same.

Other than that, your logic seems fine, and I can't see any Lua syntax errors.  (Does the "ΓΌ" work correctly?  I'm always paranoid about non-ASCII characters, so I probably would have spelled it "ue", at least during testing.)

Offline weissertigerxl

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +1/-0
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #2 on: September 08, 2011, 12:46:25 pm »
You are right, It works now.  Thanks!!!

Is there any way to findout which are the correct serviceIDs and the corresponding Status/Results?

One of the next steps would be to deal with the ED 3in1 sensor. If anybody has some examples it would help.

I have some Merten switches two. Do they have serviceID's too and can these be read out?


PS: Thanks for mask the prowl id. Did think about that ;-)

Offline mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1755
  • Karma: +11/-3
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #3 on: September 09, 2011, 08:43:39 am »
Here you can find all the service IDs and their variables and actions:
http://wiki.micasaverde.com/index.php/Luup_UPNP_Files

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #4 on: September 10, 2011, 01:01:25 am »
Is there any way to findout which are the correct serviceIDs and the corresponding Status/Results?

Yes, you can look at exactly the same files that the user interface uses.

In UI4, open up the device you are interested in, and go to its Advanced tab.  Look for the device_file entry.  Note the value (it will be a filename ending in ".xml").  (Example: a motion sensor is D_MotionSensor1.xml.)

Now go to MiOS developers > Luup files, and find the filename the same as what you just noted.  View the file (if your browser lets you) or download it and open it in a text editor.  There is text between <staticJson> and </staticJson>, which is itself a filename (ending in ".json").  View that file in your browser, or download it.  (Example: the motion sensor's staticJson file is D_MotionSensor1.json.)

What you're looking for in that file is the eventList section, customarily towards the end of the file.  In that section you'll see groups of entries, with serviceId and argumentList.  The two strings that you need are:
  • The string in serviceId (example: urn:micasaverde-com:serviceId:SecuritySensor1), and
  • The string in name inside argumentList (example: Tripped).

Copy and paste wherever possible to avoid mistyping.  Case is important too.

Offline weissertigerxl

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +1/-0
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #5 on: October 20, 2011, 02:46:13 pm »
Thanks for this help! I will try it!

Is it possible to change e.g. the name of the device. Motion_Sensor is not always exactly, what the device do?

Stefan

Offline mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1755
  • Karma: +11/-3
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #6 on: October 21, 2011, 05:15:58 am »
To rename it from the UI, open the device control panel and click on its name. (See attached image)

To rename it from Lua, use the description member of the luup.devices table.

Offline weissertigerxl

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +1/-0
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #7 on: October 24, 2011, 04:36:12 am »
Thanks mcvflorin,
but I was not exact when I described the issue :-)

I thought about not using motion_sensor for example or changing the icon inside.

Thanks Stefan

Offline mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1755
  • Karma: +11/-3
Re: Problem with Everspring WIindows sensor and LUUP code - service id
« Reply #8 on: October 24, 2011, 05:40:46 am »
You mean changing the device type. That's not possible without breaking the device.