Bed Time Lights Out

Is there a way to prevent a light from being turned on during certain hours of the day? I have a scene to shut the lights off at 9PM but I want to force them to stay off until 7AM. Unless say a smoke detector goes off.

I’m new to the Vera Automation, I just put my first z-wave switch in.

Thanks for any help you can provide

Can surely be done with the PLEG-Plugin from [url=http://rts-services.com/Vera/Plugin/PLEG/]http://rts-services.com/Vera/Plugin/PLEG/[/url].

[edit]Seems like I misunderstood your question at first. One solution would be a second relay. With no switch attached, it can’t be overriden. If you’re not electronically challenged, you may go the mysensors.org route and build your own switch, which can save you a lot of money. And eventually burn your house down ;D [/edit]

Light switches will send a signal to Vera to report change of state (immediately if instant status type or after being polled if not). Vera can then turn the light off again but I do not believe it can prevent it being turned on (unless anyone else knows different).

I think a fibaro relay on the permanent live to the switch could turn off all power to the switch but wouldn’t then be able to control the switch normally, so possibly 2 needed which is a squeeze in a back box and expensive way of doing it but I can’t think of another way. Possibly a momentary switch but I don’t have any experience if those.

If you wanted to go this way, you could use a double relay and use both contacts in series. one contact turns the supply on/off, the second contact can be controlled via the light switch.

PLEG is the best solution.

My problem with disabling lights during a certain time is what if you need that light during an emergency? Not all emergencies involve smoke!

How would you do this via pleg.
Bear in mind that the challenge is to prevent the lights being turned on at the switch.

How would you do this via pleg.[/quote]
You can’t. That is, you can’t do with with PLEG if you can’t do it any other way.

My first thought is, like simonclark and Slartibartfast, to have a Z-wave device in series control the power to the switch.

In fact, that’s really my only thought. Only I would probably put it at the breaker. A Z-wave breaker device would be ideal. There are many uses for such a thing.

But there’s no magic that PLEG brings to this situation that would lock out the light from being turned on.

The only way I can think to prevent it coming on at all is to get rid of the switch altogether and use a zwave relay like the fibaro etc.

Then in place of the switch you could have a zwave battery operated switch/secondary/scene controller.

You can put this ontop of the current switch box anyway so its in the same place.

Then use a pleg scene with the battery switch as an input.
Other than that I can’t see a better solution.

[quote=“Chrisfraser05, post:10, topic:190517”]The only way I can think to prevent it coming on at all is to get rid of the switch altogether and use a zwave relay like the fibaro etc.

Then in place of the switch you could have a zwave battery operated switch/secondary/scene controller.

You can put this ontop of the current switch box anyway so its in the same place.

Then use a pleg scene with the battery switch as an input.
Other than that I can’t see a better solution.[/quote]

This is a nice solution as you could use a double (or even triple) press to override the lockout in an emergency.

To restate the previous post …

The only way to prevent this is to have a ZWave Scene Controller (or initiator) and a separate ZWave controlled Device, preferably a relay with NO local switch to override the state of the relay.

Then you can use LUA or PLEG to grant/deny request from the Scene Controller to the the controlled device.

Place an AN145 Wireless Screw-in On/Off Module between the socket and the bulb.

Wouldn’t a Virtual Switch be good for this? Could you have a scene change the state of the VS at 9pm and 7 am respectively, and have the lights check the VS?

The problem you have is that the switch does not check vera, it happens the other way round. When vera sees a status change of the switch it will run a scene to check the VS and if required turn off the switch. This means that the light goes on and then off.
What is required is a way to stop the switch from operating hence the suggestions to turn off the supply to the switch.

Only if you replace your standard switch with a z wave scene controller that will check the virtual switch before triggering the bulb to turn on.

Why would you want to prevent the switch from operating? I suspect you mean you want to prevent them from coming on automatically.
Obviously, if someone is pressing the light switch, they want the light to come on.
A Z-Wave light switch is wired directly to the light so there’s no way to stop it and I can’t think of a logical reason to deny someone the ability to manually turn it on.

Unless maybe you want to prevent the kids from turning the lights back on when they are supposed to be sleeping.
In that case just create a scene triggered by the light coming on that just turns it back off again. They’ll be able to turn it on for a short time but it will go off again and you can even have the scene notify you when the light is turned on.

If you are turning the lights on via a Scene based on motion detector or other trigger, all you need to do is limit the time the scene can run.
In UI7 this is easy. Once you define the trigger, you just click the clock icon next to it to define the Time Restrictions.
In UI5 I don’t remember if this was built in, but if not you will have to use LUUP to do it.

Example: (Not my code. taken from another thread on this form)


local pStart = “07:00” – Start of time period
local pEnd = “22:30” – End of time period
local allow = true – true runs scene during period, false blocks it
local hS, mS = string.match(pStart,“(%d+)%:(%d+)”)
local mStart = (hS * 60) + mS
local hE, mE = string.match(pEnd,“(%d+)%:(%d+)”)
local mEnd = (hE * 60) + mE
local tNow = os.date(“*t”)
local mNow = (tNow.hour * 60) + tNow.min
if mEnd >= mStart then
return (((mNow >= mStart) and (mNow <= mEnd)) == allow)
else
return (((mNow >= mStart) or (mNow <= mEnd)) == allow)
end


[quote=“Hutchca, post:17, topic:190517”]Why would you want to prevent the switch from operating?
Obviously, if someone is pressing the light switch, they want the light to come on.
A Z-Wave light switch is wired directly to the light so there’s no way to stop it and I can’t think of a logical reason to deny someone the ability to manually turn it on.

Unless maybe you want to prevent the kids from turning the lights back on when they are supposed to be sleeping.
In that case just create a scene triggered by the light coming on that just turns it back off again. They’ll be able to turn it on for a short time but it will go off again and you can even have the scene notify you when the light is turned on.

If you are turning the lights on via a Scene based on motion detector or other trigger, all you need to do is limit the time the scene can run.
In UI7 this is easy. Once you define the trigger, you just click the clock icon next to it to define the Time Restrictions.
In UI5 I don’t remember if this was built in, but if not you will have to use LUUP to do it.

Example: (Not my code. taken from another thread on this form)


local pStart = “07:00” – Start of time period
local pEnd = “22:30” – End of time period
local allow = true – true runs scene during period, false blocks it
local hS, mS = string.match(pStart,“(%d+)%:(%d+)”)
local mStart = (hS * 60) + mS
local hE, mE = string.match(pEnd,“(%d+)%:(%d+)”)
local mEnd = (hE * 60) + mE
local tNow = os.date(“*t”)
local mNow = (tNow.hour * 60) + tNow.min
if mEnd >= mStart then
return (((mNow >= mStart) and (mNow <= mEnd)) == allow)
else
return (((mNow >= mStart) or (mNow <= mEnd)) == allow)
end
********************[/quote]

All agreed, but what the original poster asked for was a way to prevent the light from being turned on between certain hours.

Exactly.

I don’t understand why the OP would actually physically want to completely remove control by switch however, the main reason for keeping a switch is a fallback incase the HA fails in my opinion.

Worst nightmare in terms of Spousal acceptance factor is that if your Vera unit bricks, you cannot turn the lights off/on by switch without rewiring the house.

The only way I can sell the HA idea to the wife and inlaws (and lets face it, having the rest onboard makes life easy) is to say “of course you can just use the switch if my black box of tricks fails”.

But the OP asked for ideas of how he could break that last manual bridge, and that’s what we’ve all tried to offer :wink:

The problem you have is that the switch does not check vera, it happens the other way round. When vera sees a status change of the switch it will run a scene to check the VS and if required turn off the switch. This means that the light goes on and then off.
What is required is a way to stop the switch from operating hence the suggestions to turn off the supply to the switch.[/quote]

Seems odd. I guess I have the opposite setup in my Christmas Lights scene, so I’ve not noticed this.

Thanks