Author Topic: A very simple query for a beginner?  (Read 360 times)

Offline shevett

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
A very simple query for a beginner?
« on: August 01, 2018, 09:32:12 am »
Hi everyone _ I'm looking to write some code to talk to my Vera locally and query the status of some motion detectors.  A perfect solution would be to have a Python library that accessed the Vera API, but I haven't found anything like that yet.

Is there a simple way to poll the vera for the motion detector status and/or last time it triggered?  In the device settings I have

Device_type: urn:schemas-micasaverde-com:device:GenericIO:1
id: 17
json: D_GenericIO1.json

Can I just slurp down the JSON describing the state of the detector? 

Offline jswim788

  • Hero Member
  • *****
  • Posts: 798
  • Karma: +58/-2
Re: A very simple query for a beginner?
« Reply #1 on: August 01, 2018, 09:56:00 am »

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 759
  • Karma: +115/-1
Re: A very simple query for a beginner?
« Reply #2 on: August 01, 2018, 10:41:35 am »
This should help: http://wiki.micasaverde.com/index.php/Luup_Requests#variableget

See also: https://github.com/pavoni/pyvera and https://github.com/cybermaggedon/pyvera - I've never tried this, just searched.

pavoni/pyvera is the Python library used by HomeAssistant to integrate with Vera. It's excellent and well-maintained.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6201
  • Karma: +276/-70
  • "Less is more"
Re: A very simple query for a beginner?
« Reply #3 on: August 01, 2018, 12:03:18 pm »
Yes, I was going to point to that too.  Although I'm no Python fan, or any kind of expert, this does seem to be the library of choice if you really can't use Lua.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline shevett

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: A very simple query for a beginner?
« Reply #4 on: August 01, 2018, 09:19:49 pm »
This should help: http://wiki.micasaverde.com/index.php/Luup_Requests#variableget

See also: https://github.com/pavoni/pyvera and https://github.com/cybermaggedon/pyvera - I've never tried this, just searched.

pavoni/pyvera is the Python library used by HomeAssistant to integrate with Vera. It's excellent and well-maintained.

This is perfect, thank you very much!

Offline skylar

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: A very simple query for a beginner?
« Reply #5 on: August 10, 2018, 12:39:12 am »
This should help: http://wiki.micasaverde.com/index.php/Luup_Requests#variableget

See also: https://github.com/pavoni/pyvera and https://github.com/cybermaggedon/pyvera and https://19216801help.com/ - I've never tried this, just searched

pavoni/pyvera is the Python library used by HomeAssistant to integrate with Vera. It's excellent and well-maintained.
Thanks! It helps!