Author Topic: If door is opened for 5 minutes...turn off air  (Read 46329 times)

Offline aecchalet

  • Full Member
  • ***
  • Posts: 237
  • Karma: +1/-1
Re: If door is opened for 5 minutes...turn off air
« Reply #120 on: September 15, 2016, 05:41:51 pm »
I recently updated to Vera Plus from Vera 3 and undated the firmware to 1.7.2138.  I was speaking with Vera support about problems with getting my vera 3 online when I made this decision so they helped me with the transition.  They recommended that I not transfer my scenes and devices but recreate them.  This should make the system perform much more quickly. 
I decided to take Richard T. Schaffer's advice and try to do this with PLEG. (I had some trouble loading PLEG and PLC, which are the subject of another string.)
I would appreciate any comments on my first PLEG device, described below.

I created inputs using a trigger for each window and door sensor and each motion detector being tripped.
Here is the condition that I created, which would be positive when any sensored door or window was open for more than 60 seconds:
DoorWinOpen = ( tLFrBRWnOpen and ( tLFrBRWnOpen; Now > 00:60)) or ( tLHallWnOpen and ( tLHallWnOpen ; Now > 00:60)) or ( tLBkBRDrOpen and ( tLBkBRDrOpen; Now > 00:60)) or ( tLHallDrOpen and ( tLHallDrOpen; Now > 00:60)) or ( tLFrBRDrOpen and ( tLFrBRDrOpen; Now > 00:60)) or ( tLMstrBRDrOpen and ( tLMstrBRDrOpen; Now > 00:60)) or ( tULanaiDrOpen and ( tULanaiDrOpen; Now > 00:60)) or ( tUHallWnOpen; Now > 00:60)) or ( tUFrDrOpen and ( tUFrDrOpen; Now > 00:60)) or ( tUMstrBRWnOpen and ( tUMstrBRWnOpen; Now > 00:60))

Here is the condition that I created, which would be positive when it has been more than 30 minutes since any motion detector had tripped between the hours of 9 AM and 5 PM:
MDNotTrip = ( tLHallMDTrip; Now > 30:00) and ( tLMstrBRMDTrip; Now > 30:00) and ( tUGRMDTrip; Now > 30:00) and ( tUMstrBRMDTrip; Now > 30:00) and ( tUFoyMDTrip; Now > 30:00) and (09:00:00 < NOW < 17:00:00)

Then I created a logical action, which would be activated and change the SetModeTarget for each of of my 2 Trane thermostats to Off whenever the above conditions were true.  Do I need to make that "Off"? (I set options to repeat for these actions.)

The PLEG instructions say that I must restart Vera and reload browser for any newly created PLEG device to work properly.  Does that mean remotely reboot?
The instructions also say to click the Reload Luup button on the inputs, conditions or actions page.  My UI7 editor doesn't have a Reload Luup button on those pages but there is a Reload Lua button on editor options button drop down and a save changes button under the PLEG device.  I hit both of those.  Anything else that I need to do to save this?  Where is the backup button?
 
Do these conditions and logical actions look correct?

I need to test this PLEG device remotely, since I am 3000 mi away. I can set my thermostats on remotely and check remotely to see if they stay on so I don't need a dummy device to be acted upon.  Any suggestion on how I can test the conditions remotely?  I understand that I should make a dummy door/window sensor and trip it but don't know how to do either of these.  If I am supposed to use a virtualswitch and/or variablecontainer to do the test I don't understand how.

Thanks for any help!
 
« Last Edit: September 15, 2016, 10:54:18 pm by aecchalet »
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage

Offline aecchalet

  • Full Member
  • ***
  • Posts: 237
  • Karma: +1/-1
Re: If door is opened for 5 minutes...turn off air
« Reply #121 on: September 15, 2016, 10:44:01 pm »
My guest just arrived so I have people triggering motion detectors.  The motion detection part of this script doesn't work properly.  I rebooted vera and refreshed the browser then armed the PLEG device.  At that point, no one had trigger a motion detector or opened a door or window but it kept shutting off my AC within a minute of me turning it on.  I know it was the PLEG device because it stopped shutting off the AC when I put in in bypass mode.  Because this happened so quickly (<= 1 min), can I presume that the problem is in the DoorWinOpen condition?  It was 4 pm there so the time interval was true.
Anyone see any obvious mistakes?
Thanks
« Last Edit: September 15, 2016, 10:54:44 pm by aecchalet »
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10090
  • Karma: +762/-142
Re: If door is opened for 5 minutes...turn off air
« Reply #122 on: September 16, 2016, 06:13:29 pm »
I tend to ignore requests that do not include a STATUS report generated at the time of the problem to see both your logic and the state and sequence of Inputs and Conditions.
 

Offline aecchalet

  • Full Member
  • ***
  • Posts: 237
  • Karma: +1/-1
Re: If door is opened for 5 minutes...turn off air
« Reply #123 on: September 03, 2017, 08:35:36 am »
Richard, It has been a year since I wrote the PLEG program to control my AC.  I only visit my home 4 times a year and have had a variety of problems with sensors and locks but everything appears to be stable.  How do I generate a STATUS report?
Do I need to create a schedule in order for the PLEG programs to run all of the time?
I have wasted a lot of money on AC in the past year and would like to get these controls running.  Thanks for any assistance that you can give.
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1290
  • Karma: +33/-32
Re: If door is opened for 5 minutes...turn off air
« Reply #124 on: September 03, 2017, 11:22:09 am »
Try this:
Vera 3, 1.7.1030, CT101 t-stat, Everspring motion detector, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb

Offline aecchalet

  • Full Member
  • ***
  • Posts: 237
  • Karma: +1/-1
Re: If door is opened for 5 minutes...turn off air
« Reply #125 on: September 04, 2017, 01:08:38 am »
I made some changes to my devices then went to editor options/reload Lua.  Then I clicked on status report and nothing happened. 
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1290
  • Karma: +33/-32
Re: If door is opened for 5 minutes...turn off air
« Reply #126 on: September 04, 2017, 09:46:16 am »
Make sure pop ups are enabled.  You will get a new browser window with the status report.  You can then save/print it as a PDF and upload it here.  Here is a sample.
Vera 3, 1.7.1030, CT101 t-stat, Everspring motion detector, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb

Offline aecchalet

  • Full Member
  • ***
  • Posts: 237
  • Karma: +1/-1
Re: If door is opened for 5 minutes...turn off air
« Reply #127 on: April 25, 2018, 02:34:57 am »
OK, with some help, I figured out how to view a status report and to reload Lua after making any changes (much faster than rebooting Vera). 
My triggers and condition seem to work fine but the problem is with the Logic Action.  I want to shut my AC off via my Trane TZ43 thermostats.  It appears that my only logical choices for Actions are Set Mode (OFF), Set Target (0) and Set Mode Target (OFF).  None of these choices turn off the cooling or change the Mode Status from CoolOn to Off.  How do I change the thermostat Variable Mode Status from CoolOn to Off, which is not in my list of actions under PLEG for that device?  Anyone familiar with controlling this thermostat via PLEG?
I then made a scene where I used my PLEG condition and then used this thermostat's UI to click on the OFF mode.  That works fine but I would prefer to do this with a PLEG Logic action.

I have a similar problem with a Logic Action for an outlet.  My only logical choice within PLEG is Set Target but that won't turn the outlet on.  I need a way to change the outlet variable Status from 0 to 1 but it doesn't appear in my list of available PLEG actions.  Any ideas for each of these devices?
« Last Edit: April 25, 2018, 03:33:44 am by aecchalet »
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage

Offline aecchalet

  • Full Member
  • ***
  • Posts: 237
  • Karma: +1/-1
Re: If door is opened for 5 minutes...turn off air
« Reply #128 on: April 25, 2018, 10:54:33 am »
I found a luup command from oTi@ that allows me to change Mode Status (runMode) to Off:
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='<nodeID>', Data='64 1 <runMode>'},0)
Where <nodeID> is the Z-Wave NodeID (Settings->ID / Advanced->altid), so not the Device#,  of the t-stat, and <runMode> is:
0: off
1: heating
2: cooling
3: auto
4: e-heat

I understand that I would enter it in the Lua field for my Logic Action.
Do I toggle on "save output as logic variable"?
Is there a specific name that I should give this logic variable?
I am not sure what to do with this now.  This is the action that I want to take when my condition is true.
How do I execute this action?
Do I leave everything below this step blank?
« Last Edit: April 26, 2018, 03:12:11 am by aecchalet »
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage

Offline aecchalet

  • Full Member
  • ***
  • Posts: 237
  • Karma: +1/-1
Re: If door is opened for 5 minutes...turn off air
« Reply #129 on: April 28, 2018, 02:30:04 am »
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='38', Data='64 1 <runMode>'},0)
I still haven't figured out how to get the above Luup call to change the value of the thermostat mode status to OFF by entering it in the Luu box of a logical action.
I found that another logic action option for my thermostat is "Send Data".  The first field is Node for which I entered 38 (identifies the particular thermostat device).  The next field is Value. Not surprisingly, 0 doesn't work probably because I didn't specify which variable I want to set at 0.  However, I wasn't given the option to enter '64 1 <runMode>' any where.  I tried entering '64 1 <runMode>, 0' in the Value field but that didn't work.  Is there a certain format that I can use to enter this data in the fields of a logic action under "Send Data"?
Essentially, I am trying to find a way to turn off my Trane thermostat within PLEG.  It appears that I want to change the ModeStatus to Off but that is not an option for my thermostat  in PLEG.  I can't find a way to enter the Luup.call_action above as a logical action.  Does anyone know if my Node='38', Data='64 1 <runMode>' variables are correct for the modestatus variable?
« Last Edit: May 09, 2018, 10:26:53 pm by aecchalet »
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage