Extended schedules

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… :slight_smile: 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

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

I am using UI5, thanks I will look into the LUUP code… see if I can understand it a little…

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)

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)

Wouldn’t you want it to read…

local t = os.date('*t')
if (t.hour<=17) then 
  return false
end

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

Thanks all! It works… :slight_smile: 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:

return luup.is_night()

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

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?

yes, depending on the rules you want to set…