We have moved at community.getvera.com

Author Topic: Scene to turn light on if door unlocked, only between sunset and sunrise  (Read 25279 times)

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #45 on: February 11, 2010, 01:46:19 pm »
Caffreyboy:

1 . At sunrise, it is tripped; at sunset it is untripped.

2. Yes, all you have to do is set up a luup scene based on the schlage pin code event that checks the tripped variable on the daytime sensor.  If it's equal to 0, turn on front porch light.

3.  Sunset sets a state of untripped.  I didn't really mess with arming/disarming, and actually, I just added it back into the device code because I couldn't figure out how to get rid of those arm/bypass buttons.  I guess you could get some functionality out of it if you set lights to turn on/off only if the daytime sensor is armed - so it only turns the lights on and off when you're home or something.

You're probably going to want to learn a little code to get any benefit from this.  When I have a little time, I can post a sample luup scene to do what you're asking, but I'm sure with a little searching on here, you can figure out the code pretty easily.

edit.... or duh, look at denix's post right above yours....
« Last Edit: February 11, 2010, 01:47:53 pm by woodsby »
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline Caffreyboy

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #46 on: February 11, 2010, 03:17:08 pm »
Thank you for your detailed reply, but I am still struggling.

I have the following scenario set up which works properly:

1) An  ACT PIR000 motion sensor which arms at sunset and bypasses at sunrise vnery day

2) Lights come on as desired after sunset, and don't come on during the day.

Can I then query the armed status of this motion sensor, so that it becomes my sunset flag so to speak?

I tried this line of code as a luup event to turn on the lights when the Schlage lock is opened after sunset:

if (luup.variable_get("urn:schemas-micasaverde-com:device:MotionSensor:1", "Armed", 35) == "0") then
    return false
end

But it doesn't work.

Help!

Offline Caffreyboy

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #47 on: February 12, 2010, 05:51:25 pm »
Did you get a chance to see my previous reply?

I can't seem to get it solved.

Thanks!

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #48 on: February 12, 2010, 09:53:55 pm »
Did you set it up as a luup scene or luup event?
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline Caffreyboy

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #49 on: February 13, 2010, 08:49:37 am »
It's set up a luup event.

Thanks.

Offline woodsby

  • Beta Testers
  • Sr. Member
  • *****
  • Posts: 466
  • Karma: +1/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #50 on: February 13, 2010, 02:44:55 pm »
You want a luup scene. The event should be correct pincode on the schlage.
Vera1 (1.1142), Vera2 (1.1182), VRI06 (12), VRS15 (3), VRS05 (2), VRF01 (2), VRCS4 (2), ZRW113, ZRF113 (2), 45602, 45603, TZMT400 (2), FE599 (2), 99100, Thinkstick, Harmony 890Pro (2), Harmony RF Extender, Nevo S70, Nevo NC-50, Minimote, SQ Remote, SQ Blaster, EtherRain-8, Cliste ActiveRFID, TED5002

Offline Caffreyboy

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #51 on: February 15, 2010, 01:57:06 pm »
Thanks, I tried that, but still no luck.
 
Is there some command line I run tests of my luup code to see the result?

I want to see what the result of this line is, and I don't know how to see it.

if (luup.variable_get("urn:schemas-micasaverde-com:device:MotionSensor:1", "Armed", 46) == "1") then
    return false
end

Offline denix

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1088
  • Karma: +1/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #52 on: February 15, 2010, 02:44:35 pm »
AFAIK, you need to query SecuritySensor1 service instead of MotionSensor1 device for Armed state:

if (luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Armed", 46) == "1") then
    return false
end

As of testing, you can run a slightly modified code in Test Luup window (under Device -> Luup plugins) and log the output with luup.log()
Veras (1, 2, 3, Lite, Plus), lots of different Z-Wave modules, Luup plugins and theater/security integration.

Offline Maartenvt

  • Full Member
  • ***
  • Posts: 146
  • Karma: +0/-0
Re: Scene to turn light on if door unlocked, only between sunset and sunrise
« Reply #53 on: February 16, 2010, 01:44:42 pm »
MCV: Is it an idea to add 2 simple check boxes within the timer tab of a scene with:
 - Between sunset and sunrise
 - Between sunrise and sunset
Vera Edge (Firmware rev. 1.7.2406), 1x Düwi INTERACT³ light switch, 1x  ZIR010 Motion Sensor.