We have moved at community.getvera.com

Author Topic: Why won't an armed sensor over-ride a scene with a time schedule???  (Read 2801 times)

Offline chuck1026

  • Sr. Member
  • ****
  • Posts: 390
  • Karma: +3/-7
I have a scene that turns on my porch and driveway lights at sunset every evening for a few hours. I figured I could use the "trigger" feature to use an armed GCal sensor to over-ride this (such as on Halloween) but no matter what I do, the GCal sensor can't over-ride. What am I doing wrong?
UI7 / VeraPlus.... YAY, more stable than ever!

Offline chuck1026

  • Sr. Member
  • ****
  • Posts: 390
  • Karma: +3/-7
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #1 on: October 01, 2012, 05:58:20 am »
I am so frustrated :( . I can't get my trigger to stop my schedule from running. I tried removing the trigger and adding LUUP in place of the trigger but it doesn't work.

?????????

UI7 / VeraPlus.... YAY, more stable than ever!

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #2 on: October 01, 2012, 06:31:46 am »
Providing more information on how your scenes are setup would help. The more information you provide the better we can assist.

- Garrett

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #3 on: October 01, 2012, 06:34:34 am »
That's not what triggers are for.  If anything, a trigger will provide an additional way for your scene to fire, but it won't interfere with your schedule.  Triggers and schedules act independently of each other.

If you want to temporarily disable a schedule, one common way is to create a Virtual Switch (from the eponymous plugin).  Add a test to the scene's Luup tab which tests the virtual switch status, and does a return false if you want to skip the schedule.

There are plenty of examples out there on the forum that do this.  I'll try to find one.

Edit: here, here, here, here.
« Last Edit: October 01, 2012, 07:04:33 am by futzle »

Offline chuck1026

  • Sr. Member
  • ****
  • Posts: 390
  • Karma: +3/-7
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #4 on: October 01, 2012, 08:05:40 am »
I added the LUUP for a virtual switch and it refuses to work. I guess I am confused. Another example would be appreciated...

UI7 / VeraPlus.... YAY, more stable than ever!

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #5 on: October 01, 2012, 08:22:15 am »
Another example would be appreciated...

I suspect a fifth example won't add anything that wasn't in the first four.  As Garrett said: your problem is underspecified.  It looked analogous to one of those four examples to me, yet clearly it isn't.

Why don't you come in again and describe what you want to happen?  There might be a better, totally different, way to do it.

Offline chuck1026

  • Sr. Member
  • ****
  • Posts: 390
  • Karma: +3/-7
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #6 on: October 01, 2012, 08:41:32 am »
I have a scene that turns outside lights on every evening at sunset and turns the outside lights off after 4 hours. It works great as do some other daily scenes.

I want to be able have a GCal sensor over-ride them so they don't execute, say on Halloween. My Halloween GCal Sensor is urn:schemas-utz-com:device:GCal:1

I thought I could just use a GCal sensor as a trigger (armed but not tripped) along with the schedule in the scene so that it would normally run unless the GCal was tripped. It seems that triggers and schedules son't work together (which is too bad).

I guess I need to take a programming class because I feel like an idiot on here and I can't find much on-line training either :( .



UI7 / VeraPlus.... YAY, more stable than ever!

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #7 on: October 01, 2012, 09:18:34 am »
I assume you currently only have the one scene.
And the scene has 1 GCal Sensor event and a schedule or two.

What your are missing is the place to get the two to communicate. There are LOTS of ways to do this. None of them are intuitive. As folks have indicated the best way is to use a virtual switch as the place to communicate.

Create a second scene, that it triggered by the GCal to turn on the Virtual switch. (Remove it as a trigger from your existing scene).
So you give the virtual switch a name like: Ignore Schedule.
I will assume the ON state of the virtual switch means to IGNORE the schedule(s).

In the LUUP for your existing scene (The one that runs on a schedule) you would put this code to KEEP the schedules from actually running your scene:
Code: [Select]
SPS = "urn:upnp-org:serviceId:SwitchPower1"
stat = luup.variable_get(SPS, "Status", 44)
if (stat == "1") then
   return false
end
return true
When the LUUP code above returns false ... it will keep the Scene from running all of the device commands associated with the scene. Change the 44  in the code to the Device# for your virtual switch called Ignore Schedule.
If your virtual switch is Off to Ignore the scene ... then change to stat == "0" and the name of your virtual switch to Enable Schedule

You still have to get the Virtual Switch plugin downloaded and create a virtual device with it.

« Last Edit: October 01, 2012, 09:46:29 am by RichardTSchaefer »

Offline chuck1026

  • Sr. Member
  • ****
  • Posts: 390
  • Karma: +3/-7
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #8 on: October 01, 2012, 09:42:27 am »
Thanks Richard! I'll give it a try and follow up on here (success or not).

Chuck
UI7 / VeraPlus.... YAY, more stable than ever!

Offline chuck1026

  • Sr. Member
  • ****
  • Posts: 390
  • Karma: +3/-7
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #9 on: October 01, 2012, 11:54:39 am »
I must be an idiot or something. I created a new scene to flip the virtual switch, ID 34, on when GCal is triggered. That scene is okay.

Then I deleted the trigger in my existing light schedule.

Then I added the following LUUP:

Code: [Select]
SPS = "urn:schemas-upnp-org:device:VSwitch:1"
stat = luup.variable_get(SPS, "Status", 34)
if (stat == "1") then
   return false
end
return true


2nd part is not working... ?!?
« Last Edit: October 03, 2012, 01:52:27 pm by oTi@ »
UI7 / VeraPlus.... YAY, more stable than ever!

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #10 on: October 01, 2012, 05:33:11 pm »
SPS = "urn:schemas-upnp-org:device:VSwitch:1"

This string is definitely wrong.  It looks like a Service Type string.  You need a Service ID string.  It's a common rookie mistake, don't feel bad.

Search the forum for "hover mouse" and you'll see countless previous posts explaining how you find the service ID string.

Offline chuck1026

  • Sr. Member
  • ****
  • Posts: 390
  • Karma: +3/-7
Re: Why won't an armed sensor over-ride a scene with a time schedule???
« Reply #11 on: October 01, 2012, 07:11:37 pm »
SPS = "urn:schemas-upnp-org:device:VSwitch:1"

This string is definitely wrong.  It looks like a Service Type string.  You need a Service ID string.  It's a common rookie mistake, don't feel bad.

Search the forum for "hover mouse" and you'll see countless previous posts explaining how you find the service ID string.


I just did the hover trick and changed it to:

Code: [Select]
SPS = "urn:upnp-org:serviceId:VSwitch1"
stat = luup.variable_get(SPS, "Status", 34)
if (stat == "1") then
   return false
end
return true

SUCCESS!!!  :D :D :D

Thanks for the help. Maybe this is the kick in the shorts I need to really start to get the hang of LUUP.
« Last Edit: October 03, 2012, 01:52:43 pm by oTi@ »
UI7 / VeraPlus.... YAY, more stable than ever!