We have moved at community.getvera.com

Author Topic: SmartThings Presence FOB "integration" with Vera  (Read 13410 times)

Offline Dignan17

  • Sr. Member
  • ****
  • Posts: 256
  • Karma: +2/-0
Re: SmartThings Presence FOB "integration" with Vera
« Reply #15 on: September 17, 2014, 01:10:27 pm »
Thanks for the clarification. I can't see how to make a virtual presence sensor, but I'll test it out with the real thing.

Offline Dignan17

  • Sr. Member
  • ****
  • Posts: 256
  • Karma: +2/-0
Re: SmartThings Presence FOB "integration" with Vera
« Reply #16 on: September 18, 2014, 09:21:07 pm »
Success! Huzzah! Thanks so much for the help, idefix. It works perfectly, and for both the fob and my phone. That'll save me money since I can just use the phone presence for my wife and I, and attach my one fob to our kid's diaper bag. That way we won't turn off all the lights if we leave our child with a babysitter.

Now I just need to learn how to use PLEG. I didn't know it would be so complicated. Is there a particularly good thread here that explains it? I ask, because I can't quite grasp the explanation on the PLEG web site...

Offline idefix

  • Full Member
  • ***
  • Posts: 100
  • Karma: +1/-1
Re: SmartThings Presence FOB "integration" with Vera
« Reply #17 on: September 18, 2014, 09:24:59 pm »
Have a look at the pleg wiki. Pretty comprehensive info on how to get started. Good luck.

Offline Dignan17

  • Sr. Member
  • ****
  • Posts: 256
  • Karma: +2/-0
Re: SmartThings Presence FOB "integration" with Vera
« Reply #18 on: September 18, 2014, 09:54:24 pm »
Have a look at the pleg wiki. Pretty comprehensive info on how to get started. Good luck.
Thanks! I found the PDF manual in one of the sticky threads and that was very helpful for getting started. I can easily create a PLEG (or whatever it's called) to carry out an action once all presence sensors have left the house. What I'm struggling with now is how to create an algorithm for the return. I don't want a simple phrase like "Fob1Returns or Fob2Returns or Fob3Returns." I mean, I do, but I want it to only trigger when any of those three are true after all three have been away.

In other words, I don't want to trigger a return scene if only one presence sensor comes back. That would get annoying for the people who never left :) I also don't want to require all three sensors to return.

How do I write this? Have you done something similar?

Offline smwein

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: SmartThings Presence FOB "integration" with Vera
« Reply #19 on: October 22, 2014, 05:01:10 pm »
When I try to paste the code into the Smart App I get "Metadata definition not found" 

Thanks

Offline idefix

  • Full Member
  • ***
  • Posts: 100
  • Karma: +1/-1
Re: SmartThings Presence FOB "integration" with Vera
« Reply #20 on: October 22, 2014, 07:44:47 pm »
You need to create a new app in the smartthings developer page and paste it there. Have a look at the inbuilt sample apps to see how to compile, test and deploy.

Sent from my GT-I9505G using Tapatalk


EarlyMorningHours

  • Guest
Re: SmartThings Presence FOB "integration" with Vera
« Reply #21 on: November 04, 2014, 03:06:24 pm »
Deleted
« Last Edit: February 09, 2016, 02:11:24 pm by EarlyMorningHours »

Offline idefix

  • Full Member
  • ***
  • Posts: 100
  • Karma: +1/-1
Re: SmartThings Presence FOB "integration" with Vera
« Reply #22 on: November 04, 2014, 07:50:46 pm »
Unfortunately I have not gone beyond the presence fob yet :-( (actually I wanted to add a feedback loop to make sure that ST pushes the message to vera till it gets an acknowledge that the switch was changed but did not get around to do this yet. )

Sent from my GT-I9505G using Tapatalk


Offline danielccm

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: SmartThings Presence FOB "integration" with Vera
« Reply #23 on: September 02, 2017, 11:53:07 am »
Hi,

I purchased a SmartThings Controller and have it running standalone alongside my Vera (I'm not using it as secondary zwave controller) to solve the presence issue I had - Android phones with tasker was always a hit an miss.

I will use ST probably for other Zigbee stuff in the future but for now it is a presence detector only  ;D

I integrated the 2 by writing a app for SmartThings which will trigger virtual switches on my vera once changes in presence are detected.
In addition ST will send me a notification on the phone.

In case someone is keen to do the same, you will need:
  • SmartThings Controller - upgraded to lab FW as otherwise the local LAN HTTP push will not work (see the ST forum on how to request this)
  • as many presence FOB's as you need
  • the below app which needs to be installed on your ST via the IDE

Good luck !

Code: [Select]
/**
 *  Presence Presence Update in Vera & Push Notification
 *
 *  Author: SmartThings, adapted by Idefix
 *
 *  use http://tuxgraphics.org/toolbox/network_address_calculator_add.html to convert your IP
 *  (Convert dotted decimal IP-address or mask to binary and hex) and port (Convert decimal to binary and hex) to hex
 *
 *  VeraID is the DeviceID of the switch you want to control. Look for it in the Device Advanced tab in Vera
 *
 *  Device will be set to ON when presence is detected and OFF upon leaving
 *
 */

preferences {
section("When a presence sensor arrives or departs this location..") {
input "presence", "capability.presenceSensor", title: "Which sensor?"
}
section("Set Vera DeviceID...") {
input "VeraID1", "number", title: "DeviceID"
}
}

def installed() {
subscribe(presence, "presence", presenceHandler)
}

def updated() {
unsubscribe()
subscribe(presence, "presence", presenceHandler)
   
}

def presenceHandler(evt) {

def deviceNetworkId = "0A0A000A:D98"  //  "10.10.0.10:3480" update with your Vera IP in hex format
def ip = "10.10.0.10:3480"            // This is the ip and port of the Vera in the network

if (evt.value == "present") {
log.debug "${presence.label ?: presence.name} has arrived at the ${location}"
   
sendHubCommand(new physicalgraph.device.HubAction("""GET /data_request?id=lu_action&DeviceNum=${VeraID1}&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1 HTTP/1.1\r\nHOST: $ip\r\n\r\n""", physicalgraph.device.Protocol.LAN, "${deviceNetworkId}"))

sendPush("${presence.label ?: presence.name} has arrived at the ${location}")

} else if (evt.value == "not present") {
log.debug "${presence.label ?: presence.name} has left the ${location}"

sendHubCommand(new physicalgraph.device.HubAction("""GET /data_request?id=lu_action&DeviceNum=${VeraID1}&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0 HTTP/1.1\r\nHOST: $ip\r\n\r\n""", physicalgraph.device.Protocol.LAN, "${deviceNetworkId}"))

sendPush("${presence.label ?: presence.name} has left the ${location}")
}
}

Hi!

I want to simply use a smartthings presence fob with Vera, but there's no st hub in this location.. can I still do it somehow?

Thanks!

Offline capjay

  • Hero Member
  • *****
  • Posts: 675
  • Karma: +9/-3
Re: SmartThings Presence FOB "integration" with Vera
« Reply #24 on: September 24, 2017, 06:37:13 pm »

Hi!

I want to simply use a smartthings presence fob with Vera, but there's no st hub in this location.. can I still do it somehow?

Thanks!

AFAIK, the ST Fobs only work with the ST Hub..

Offline daryletilroe

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: SmartThings Presence FOB "integration" with Vera
« Reply #25 on: January 24, 2019, 12:23:39 am »
Bit of thread necromancy here, but really this is pretty much the exact topic I want to discuss so I won't spawn a new one.

I have be searching high and low for a very simple presence detection fob and I was surprised to find they are a pretty rare thing.

I don't need nor want a fancy multi button remote.  I just want a small, cheap, simple fob with great battery life (and ideally very durable and waterproof) to determine presence or absence.  I was surprised at this apparent market gap because this need is quite common for several applications, and in particular in the rental market when you need to remotely track the return of spare keys, other 3rd party system cards and fobs, etc.

Anyhow it seems the only thing remotely close, albeit not that durable or waterproof, is the Samsung F-ARR-US-2 https://www.amazon.com/Samsung-SmartThings-F-ARR-US-2-Arrival-Sensor/dp/B00GM7V8I8.

Since I only have a Vera Plus controller at present, and would really like to keep it and keep it simple with only that controller, I was wondering if the that Samsung SmartThings FOB will yet work directly with the Vera?

Barring that is there any other really simple product I have missed?

Thanks!