Author Topic: Vera, Alexa, door locks and scenes. Oh My!!!!  (Read 511 times)

Offline owensct

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-0
Vera, Alexa, door locks and scenes. Oh My!!!!
« on: July 21, 2018, 12:06:42 pm »
Hi All,

I know that Alexa/Vera doesn't do locks unless you set it to allow them with a pin code, even the pin code approach doesn't seem to work though. I have 3 Kwikset locks on my house connected to Vera. Using Alexa I can tell it to lock the individual doors, (no pin code needed) ie Alexa lock the front door, etc. As far as I can tell there is no command equivalent to Alexa lock all doors.

My goal here is to create a scene to basically shut the house down for the night:
Check/lock all doors
turn lights on in the master bedroom
adjust ceiling fans to night mode
etc, etc

Alexa will not as far as I can tell accept lock commands as part of a scene, even just to lock them. I can get Alexa to run a scene I created that works as long as it has no locks in it.

I found some Lua code on the forum that is supposed to allow you to lock the doors via a scene, but lua coding isn't my strong point so I'm not sure if there is a problem with the code or if I'm putting it into a scene incorrectly. The code is, (where xx is the id of the lock):

Luup.call_action("urn:micasaverde-com:serviceId:DoorLock1,"SetTarget",{newTargetValue = "1"}, xx)

Any assistance would be greatly appreciated.

Thanks

Gordon

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6204
  • Karma: +276/-70
  • "Less is more"
Re: Vera, Alexa, door locks and scenes. Oh My!!!!
« Reply #1 on: July 21, 2018, 12:36:37 pm »

Code: [Select]
Luup.call_action("urn:micasaverde-com:serviceId:DoorLock1,"SetTarget",{newTargetValue = "1"}, xx)
Any assistance would be greatly appreciated.


If you tried it as you have written it there, then the capital L in Luup will not be helping you.  Try it with lower case.  Also, your string quoting is wrong.

Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:DoorLock1","SetTarget",{newTargetValue = "1"},xx)

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 Nameless

  • Full Member
  • ***
  • Posts: 189
  • Karma: +4/-0
Re: Vera, Alexa, door locks and scenes. Oh My!!!!
« Reply #2 on: July 21, 2018, 03:04:48 pm »
I built into my "Night Mode" to lock my doors and Alexa will do it without a scene. Turning it to Night arms my alarm and sensors, locks all locks including my garage door (shutting it), and adjusts my thermostat. No additional code needed.

Make sure you have the modes plugin installed. Alexa can see those, if I recall correctly.

Sent from my LGUS992 using Tapatalk


Offline owensct

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-0
Re: Vera, Alexa, door locks and scenes. Oh My!!!!
« Reply #3 on: July 21, 2018, 03:57:42 pm »
Awesome. Thanks, I appreciate the responses. I'll give those two options a shot.

Gordon

Offline owensct

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-0
Re: Vera, Alexa, door locks and scenes. Oh My!!!!
« Reply #4 on: August 03, 2018, 05:16:02 pm »
Hi All,

Just wanted to respond back to let you guys know that I went with the luup code and it worked great. All I have to do is say Alexa turn on lockup and it runs the scene and locks all 3 doors.

Thanks again

Gordon