Can I do this without LUUP?

Hi all, new user in New Zealand… I have read various threads but can’t quite get my head around the right way to do what I want to do and would be grateful for some guidance.

I have a set of high level windows used for cooling that I can open and close through Vera. I have just installed the plugin for a Nest thermostat (working great so far on Hawaii time which is 1 hour ahead and a day behind us)

The Nest is typically set at target 20 degrees.

  • If current temp goes above say 23 I want to be able to open the windows halfway, which is achieved by hitting open and then 15 seconds later hitting stop.
  • If current temp goes higher again, say 24, I want to open all the way, achieved just by hitting open.
  • But only during daylight hours
  • I want the windows to be closed at sunset regardless of the current temperature.

Can I do this using a set of scenes, or do I need to wrap my head around PLEG? I’m pretty sure LUUP is beyond me.

Any advice appreciated

The KiWi’s treated me nice when I was there … So I will help you get started …

This is not complete … Do the windows have a way of reporting their status, like a dimmer ? How about if they are closed ?

Install the following Plugins:

[ul][li]Day or Night[/li]

After installing all 3 then restart your browser.

Make sure the Vera is setup properly for your location and timezone (See the Vera Dashboard: Setup → Location)
This is so that Vera can compute sunrise/sunset correctly.

Setup the DayOrNight plugin.
I usually use consider it day at 20 minutes before Sunrise and Night at 20 minutes after sunset.
If you think about solving problem by:


In PLEG SOMETHINGHAPPENS is called a condition and SOMETHINGABOUTIT is called an action.
All conditions have a name. And when they become true … the associated actions are executed.
In PLEG Setup as follows:
Input Trigger:
Name:Night - The Day Or Night Plugin indicating Night

Input Device Property
Name: NestTemp - Attached to the Nest Current Temperature
Name: NestCSP - Attached to the Nest Cooling Setpoint

Day Not Night
DeltaTemp NestTemp - NestCSP
PartialOpen Day and (DeltaTemp > 3) and (DeltaTemp < 4)
FullOpen Day and (DeltaTemp > 4)
Close Night or (Day and (DeltaTemp < .5))

Immediate Open
Delayed 15s Stop

Immediate Open

Immediate Close

Other things to consider:

[ul][li]If you can sense the windows are closed … then do not need to send another closed command.[/li]
[li]Maybe connect to Weather Plugin … Do not allow Open if Bad Weather
i.e. it’s raining.
Maybe limit to partial open if the outside temp is less than CoolSP - 10[/li]
[li]Currently I do not have logic to go from Full Open to Partial Open[/li][/ul]

Hi Richard,

Wow - thank you for those detailed instructions.

The windows can’t report on partially open or closed status - when partially open they will report as being either 100% open or closed depending on which way they were last moving.

I was able to do all of your instructions except for this one:

“Name: NestCSP - Attached to the Nest Cooling Setpoint”

I don’t seem to have a “Nest Cooling Setpoint” variable available. Could this be because I only have heating connected to my Nest and it knows this so doesn’t offer a cooling variable?

Thanks again for your help - I should also be grateful to my fellow Kiwis that were nice to you when you were here I guess :wink:


On your further points…

[ul][li]If you can sense the windows are closed ... then do not need to send another closed command.[/li][/ul]
As above - I can't reliably sense this so will want to issue the command regardless
[ul][li]Maybe connect to Weather Plugin ... Do not allow Open if Bad Weather i.e. it's raining.
I have set up the wunderground plugin and there's a PWS near me but not sure I need it as these high level windows are well under the eaves and so far (since we moved in) there's been no water coming in. Thanks for the tip though.
Maybe limit to partial open if the outside temp is less than CoolSP - 10[/li][/ul]
Yes this could be a good idea. Maybe also do this for bad weather as maybe the rain would get in if they're fully open.
[ul][li]Currently I do not have logic to go from Full Open to Partial Open[/li][/ul]
Is that not just the same as full closed to partial open? i.e. initiate close and then stop 15s later? This assumes 30s from full open to full close and viuce versa, which is approx. correct.

On my Z-Wave thermostat it’s called SetpointTarget
There are two of them … so you need to try it and see if it matches the heating or cooling … than pick the appropriate one.

If you really do not have one … create a first condition as follows:
NestCSP 20

Also I though that maybe when you set the thermostat to OFF it should probably keep the Windows closed … then you can think about controlling the temperature via the thermostat!

I think you have the hang of it … When you are done … you might post your status command as an example for others.

I have some thoughts about partial close … but I need to think about it. It will have a lot more state transitions to deal with.

I think I found it - there are two called “CurrentSetpoint” so I’ll try the first and see what happens. So that should be all set up - fantastic, I’ll report back on how it goes.

This has been really useful for me as a PLEG tutorial also - I think I get how it fits together so thank for that (and for providing PLEG in the first place!)

Where do I get the status command from to post that?

Edit to add… this message is showing in the MIOS header - is it an error message?
Program Logic : Night or (Day and (DeltaTemp < .5)): attempt to compare number with nil

Richard or anyone else who might advise…

I changed the condition that was generating the error in my post above to
“Night or (Day and (DeltaTemp < 0))”
and the error message no longer appears, but I don?t seem to be getting any action out of this - ie the windows have not moved when they should have.

The Status report is below ? it shows right now PartialOpen is true but the windows haven?t moved (are still closed)

Program Logic Event Generator
Device ID: 242013-11-18 09:05:14.408PLC Version: 5.3

Name Description Last Trigger State
Night Day or Night indicates Night time. 2013-11-17 20:21:03.126 false

Device Properties
Name Device Name Device Variable Last Change Value
NestTemp Nest CurrentTemperature 2013-11-18 07:46:36.339 23
NestCSP Nest CurrentSetpoint 2013-11-17 18:25:26.100 20

Name Expression Last True State
Day Not Night 2013-11-18 05:48:32.121 true
DeltaTemp NestTemp - NestCSP 2013-11-16 19:39:16.675 3
PartialOpen Day and (DeltaTemp > 2) and (DeltaTemp < 4) 2013-11-18 08:29:49.777 true
FullOpen Day and (DeltaTemp > 4) 2013-11-17 16:08:01.261 false
Close Night or (Day and (DeltaTemp < 0)) 2013-11-17 20:36:16.692 false

Actions for Condition: PartialOpen
Device Action Arguments
Clerestory Windows Up
Delay 15
Device Action Arguments
Clerestory Windows Down
Actions for Condition: FullOpen
Device Action Arguments
Clerestory Windows Up
Actions for Condition: Close
Device Action Arguments
Clerestory Windows Down

I assumed I have to set ARM on the PLEG control screen and have done that. Is there anything else I need to have set for this to run?

Is there a stop action as opposed to a close command ?
Is the window partially opened ?
If you armed the PLEG after the trigger … it will not be synced up until the next event.
Change the Cool SP to 25 … See if it closes.
If it does then lower it back 1 degree at a time … and see when it starts to move (You can check the
Status report as well to see what it thinks).