We have moved at community.getvera.com

Author Topic: Extended schedules  (Read 1936 times)

Offline riochicken

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Extended schedules
« on: June 05, 2012, 04:44:08 am »
Hi,

Since two months I am a very satisfied user of a Vera2 and several Zwave components, started out with two dimmable light switches and yesterday I received my 3in1 sensor and another non-dimmable light switch (for a already dimmed light), I found out that it is not possible to activate a device or a scene over a certain period of time, I think this might be a very good thing to include in a next firmware release, unless somebody has some other idea's of course.. :) I tried to do so for the light senstivity function of my new 3in1 sensor, I would like to make it function (poll) during a certain period of time, for instance from 18:00 till 24:00 if level of light is <10 then turn on light.

Any idea's?

Thanks!!

Richard


Offline capjay

  • Hero Member
  • *****
  • Posts: 675
  • Karma: +9/-3
Re: Extended schedules
« Reply #1 on: June 05, 2012, 06:24:11 am »
Are you using UI4 or UI5?
In order to do what you want, you will need to add a tiny bit of LUUP code.
to read more about using LUUP see: http://wiki.micasaverde.com/index.php/Luup_Scenes_Events

Offline riochicken

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: Extended schedules
« Reply #2 on: June 08, 2012, 03:43:34 am »
I am using UI5, thanks I will look into the LUUP code.. see if I can understand it a little..

Offline capjay

  • Hero Member
  • *****
  • Posts: 675
  • Karma: +9/-3
Re: Extended schedules
« Reply #3 on: June 08, 2012, 04:47:56 pm »
in UI5, you should do the following:
1. create a new scene under automation (for turning on the light)
2. under devices, find the light and choose to turn it on.
3. under triggers, choose your light sensor, select brightness reached < 10
this way the light will turn on whenever the brightness is less than 10. In order to add the time restriction:
4. under LUUP add this code (to prevent the scene from running if the hour is less than 18)
Code: [Select]
local t = os.date('*t')
if (t.hour<=18) then
  return false
end
5. Save Lua and Confirm changes.

At this point, you created a scene to turn on the light. You need to create the scene to turn it off, depending on your need (for example, turn it off whenever light level >10 or whatever)

Offline DaveGee

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +0/-0
Re: Extended schedules
« Reply #4 on: June 08, 2012, 08:18:07 pm »
Wouldn't you want it to read...

Code: [Select]
local t = os.date('*t')
if (t.hour<=17) then
  return false
end

Or 'if (t.hour<18) then ' ...?

Offline riochicken

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: Extended schedules
« Reply #5 on: June 10, 2012, 02:58:44 pm »
Thanks all! It works... :) not as hard as I tought... Is there a way to include sunset?

Offline capjay

  • Hero Member
  • *****
  • Posts: 675
  • Karma: +9/-3
Re: Extended schedules
« Reply #6 on: June 10, 2012, 04:59:27 pm »
Thanks all! It works... :) not as hard as I tought... Is there a way to include sunset?

Assuming that you want this to happen after sunset (rather than 18.00 to 24.00), then just put the following line into LUUP:

Code: [Select]
return luup.is_night()

Offline riochicken

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: Extended schedules
« Reply #7 on: June 11, 2012, 02:09:17 am »
Thanks all! It works... :) not as hard as I tought... Is there a way to include sunset?

Assuming that you want this to happen after sunset (rather than 18.00 to 24.00), then just put the following line into LUUP:

Code: [Select]
return luup.is_night()

Cool, but this will mean that it runs also during the night, but that's a matter of just putting an extra if/end in it right?

Offline capjay

  • Hero Member
  • *****
  • Posts: 675
  • Karma: +9/-3
Re: Extended schedules
« Reply #8 on: June 11, 2012, 10:53:59 am »
yes, depending on the rules you want to set..