Author Topic: New Plugin: SiteSensor  (Read 5045 times)

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2405
  • Karma: +33/-45
  • Life Moves Pretty Fast....
Re: New Plugin: SiteSensor
« Reply #15 on: December 25, 2017, 01:13:25 pm »
Hi @rigpapa

I was just wondering - could your plugin work with the Ring Doorbell ? Here?s some information on what is communicated.

http://www.kidder.io/2017/07/04/ring-doorbell-api/

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 404
  • Karma: +58/-0
Re: New Plugin: SiteSensor
« Reply #16 on: December 26, 2017, 02:27:39 pm »
The linked page describes the interface between the doorbell and Ring's servers. While you could mimic the doorbell's requests to Ring, I'm not sure it would get you much, as the most interesting things to do here seem to revolve around initiating the SIP connection between the doorbell (as originator) and the server (as gateway), and if initiated by SiteSensor on the Vera, the usual originator (doorbell) likely would not be in a state where it would know to complete the connection.

I'm not a Ring user yet. I got my wife one for Christmas, so in a couple of days I surely will be. Maybe once that happens, I can try it and see what surprises come out of it.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 948
  • Karma: +21/-31
Re: New Plugin: SiteSensor
« Reply #17 on: December 26, 2017, 03:45:48 pm »
The linked page describes the interface between the doorbell and Ring's servers. While you could mimic the doorbell's requests to Ring, I'm not sure it would get you much, as the most interesting things to do here seem to revolve around initiating the SIP connection between the doorbell (as originator) and the server (as gateway), and if initiated by SiteSensor on the Vera, the usual originator (doorbell) likely would not be in a state where it would know to complete the connection.

I'm not a Ring user yet. I got my wife one for Christmas, so in a couple of days I surely will be. Maybe once that happens, I can try it and see what surprises come out of it.

Thanks, I have a lot of interest too as a Ring user. Vera's official stance is they won't integrate half of the device meaning Ring won't expose the video portion and Vera stopped talking about it. Many said it did not matter (including myself) as we wouldn't use Vera for video but a real integration of the events such as the door bell ringing and the motion notification. Those can easily trigger scenes and everyone would use the video from the Ring app itself.

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2405
  • Karma: +33/-45
  • Life Moves Pretty Fast....
Re: New Plugin: SiteSensor
« Reply #18 on: December 26, 2017, 04:45:33 pm »
Agree with @tomtcom

Being able to capture and use motion information would be good, so much so that I  had been using the Home Assistant app/setup to benefit from their integration with Ring.

There seems to be a number of people who reverse engineered the api and this one is in Php - https://github.com/jeroenmoors/php-ring-api/blob/master/ring.php

It would be cool to get sole form of basic integration with Ring for Vera.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1258
  • Karma: +31/-32
Re: New Plugin: SiteSensor
« Reply #19 on: December 26, 2017, 08:08:38 pm »
I use Blue Iris to trigger motion from 4 cameras to Vera. Does Ring work with Blue Iris? I would think so.
Vera 3, 1.7.1030, CT101 t-stat, Everspring motion detector, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb

Offline Nameless

  • Full Member
  • ***
  • Posts: 144
  • Karma: +3/-0
Re: New Plugin: SiteSensor
« Reply #20 on: December 26, 2017, 11:03:47 pm »
I use Blue Iris to trigger motion from 4 cameras to Vera. Does Ring work with Blue Iris? I would think so.

Ring does not work with Blue Iris currently. A good video doorbell has yet to become available with that software. Hikvision makes one, but it rates very poor on the Blue Iris forum.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1258
  • Karma: +31/-32
Re: New Plugin: SiteSensor
« Reply #21 on: December 27, 2017, 08:55:14 pm »
I use Blue Iris to trigger motion from 4 cameras to Vera. Does Ring work with Blue Iris? I would think so.

Ring does not work with Blue Iris currently. A good video doorbell has yet to become available with that software. Hikvision makes one, but it rates very poor on the Blue Iris forum.

Hmm. Their website indicates it is a Wi-Fi device.  I would think Blue Iris could find it and stream its feed through its interface. I did notice its operating temperature range is -5F to 120F.  For an outdoor device, I would expect -20F to 140F.
Vera 3, 1.7.1030, CT101 t-stat, Everspring motion detector, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 404
  • Karma: +58/-0
Re: New Plugin: SiteSensor
« Reply #22 on: December 29, 2017, 03:29:54 pm »
It appears that the device protocol is SIP for establishing video chat sessions, like a video-capable VoIP phone. It is effectively a one-button VoIP phone that can only dial one number, the Ring mother ship. Unless BlueIris supports SIP (the version 4.something I have does not), I don't see how it could use Ring as a camera. Again, my experience with the device is very limited, but based on the specs of each, I don't see how they'd connect.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 948
  • Karma: +21/-31
Re: New Plugin: SiteSensor
« Reply #23 on: December 29, 2017, 07:07:39 pm »
It appears that the device protocol is SIP for establishing video chat sessions, like a video-capable VoIP phone. It is effectively a one-button VoIP phone that can only dial one number, the Ring mother ship. Unless BlueIris supports SIP (the version 4.something I have does not), I don't see how it could use Ring as a camera. Again, my experience with the device is very limited, but based on the specs of each, I don't see how they'd connect.

Thanks rigpapa. So based on the link provided what about responses on motion events and ringing of the bell? Perhaps eliminating the video component all together. We would always use the Ring app but in Vera, I'd like to hook the motion/ringing activities as devices that could launch scenes.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1258
  • Karma: +31/-32
Re: New Plugin: SiteSensor
« Reply #24 on: December 29, 2017, 08:15:14 pm »
It appears that the device protocol is SIP for establishing video chat sessions, like a video-capable VoIP phone. It is effectively a one-button VoIP phone that can only dial one number, the Ring mother ship. Unless BlueIris supports SIP (the version 4.something I have does not), I don't see how it could use Ring as a camera. Again, my experience with the device is very limited, but based on the specs of each, I don't see how they'd connect.

Thanks for the information. Will look for other solutions in the future.
Vera 3, 1.7.1030, CT101 t-stat, Everspring motion detector, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb

Offline rearden

  • Sr. Newbie
  • *
  • Posts: 48
  • Karma: +0/-0
Re: New Plugin: SiteSensor
« Reply #25 on: February 01, 2018, 06:00:04 pm »
Thank you for this plugin.  It seems to be quite useful.  I am using it to pull data from my local Emoncms on a raspberry pi.  It pulls watts from an Input.  I have solar panels and want to know when I am exporting power so I can turn on additional loads and turn them off when my power import exceeds a value.  I will use the vera as a coarse power diverter.

So far I have SiteSensor pulling back the watts value and it will trigger when watts exceeds a specified value.  Is there a way to expose the response.value so that it can be used in a scene?  Right now when I go to write a scene, it only gives me variations of armed/disarmed and tripped/not tripped as the trigger condition.  I need to trigger scenes based on the value exceeding X (turn on) and run a different scene when the value is less than Y (turn off).  X and Y are not the same (because turning on a load changes the trigger value) and I need something more than a hard inequality.

Rearden
« Last Edit: February 01, 2018, 06:01:49 pm by rearden »

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 404
  • Karma: +58/-0
Re: New Plugin: SiteSensor
« Reply #26 on: February 02, 2018, 05:22:37 pm »
OK, I can fairly easily expand on SiteSensor's scene options to make this easier. I'm getting ready to an update this weekend, which would publish Monday if Vera stays to their usual schedule.

For the moment, I recommend making an additional SiteSensor device (go to My Apps, click on Details where SiteSensor is listed, and click the "Create another" button. Have one instance trigger when watts > X, and the other trigger when watts < Y. Then have your "high watts" scene trigger from the first instance going into triggered state, and your "low watts" scene trigger when the second instance goes into triggered state.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 404
  • Karma: +58/-0
Re: New Plugin: SiteSensor
« Reply #27 on: February 04, 2018, 12:14:45 pm »
Just confirming, version 1.4 has gone into the approval queue with Vera, and they should approve it shortly. This will provide additional scene/notification/PLEG trigger options based on the 8 user-definable expressions. See the first post in this thread for full release notes.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline rafale77

  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +52/-21
Re: New Plugin: SiteSensor
« Reply #28 on: February 04, 2018, 11:32:16 pm »
Updated the plugin and now it is failing to evaluate a json

See the log
Code: [Select]
Response HTTP status 200, body={"val":8,"ack":true,"ts":1517804967381,"q":0,"from":"system.adapter.mihome-vacuum.0","lc":*********,"_id":"mihome-vacuum.0.info.state","type":"state","common":{"name":"Vacuum state","type":"number","read":true,"max":30,"states":{"1":"Unknown 1","2":"Sleep no Charge","3":"Sleep","5":"Cleaning","6":"Returning home","7":"Manuell mode","8":"Charging","10":"Paused","11":"Spot cleaning","12":"Error?!"}},"native":{}}

20:29:34: Failed to execute `response.val', { message="Invalid reference", type="evaluation", source=

I would use a reference to evaluate response.val which is the first value but it keeps on returning a nill value. There seems to be a typo in the code where the ' became a `

Apparently the shortcut expression with only one term after the "response" no longer works. I have had to use the response['var'] expression
« Last Edit: February 04, 2018, 11:38:01 pm by rafale77 »
openLuup (96 devices, 122 scenes, 20 apps) controlling HomeAss + VeraPlus (133 zwave nodes, 8 Zigbee nodes, 200 devices, 34 scenes , 1 apps) Bridged to Homekit and Alexa

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 404
  • Karma: +58/-0
Re: New Plugin: SiteSensor
« Reply #29 on: February 05, 2018, 07:04:04 am »
The odd quote mark is just me going old school Unix in the error message. Showing my age I guess. The problem is that the structure of your data is making luaxp mistake the table for one of its atoms, and it doesn't want that there. Your solution is the correct one--change the reference form to a quoted identifier--for the moment. I'll tighten up luaxp today and post an updated library. Thanks for the report.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.