If door is opened for 5 minutes...turn off air

I made some changes to my devices then went to editor options/reload Lua. Then I clicked on status report and nothing happened.

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.

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?

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=‘’, Data=‘64 1 ’},0)
Where is the Z-Wave NodeID (Settings->ID / Advanced->altid), so not the Device#, of the t-stat, and 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?

luup.call_action(‘urn:micasaverde-com:serviceId:ZWaveNetwork1’,‘SendData’,{Node=‘38’, Data=‘64 1 ’},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 ’ any where. I tried entering ‘64 1 , 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 ’ variables are correct for the modestatus variable?

I still haven’t figured out why I can’t shut off my AC at my thermostats with PLEG. I created devices for each door & window sensor. I created a condition to be true when any of the door or window sensors are open for more than 60 secs. My problem is that I can’t get my logical action to work properly. I chose the desired condition then select both thermostats. It appears that my only drop down logical choice is ModeTarget = Off. When I test the logical action after saving it and clicking the run button, the status report indicates that the ModeTarget has been correctly changed to Off. However, it doesn’t shut off my AC. When I open the thermostat device in UI7 of the AC unit that is running, go to advanced and then the variables tab, the ModeTarget is still set on CoolOn. The same thing happens when I try to create a logical action to turn on the AC by changing the ModeTarget to CoolOn. The status report will indicate that the ModeTarget is CoolOn but the AC will not turn on and the Variable field in the thermostat is still Off.
My work around has been to use that condition to trigger a scene. When the condition is true, my scene will turn off the AC. When it does so, the variable tab shows that the ModeTarget switches from CoolOn to Off. I just can’t get the PLEG logical action to do that!
I have attached my status report if anyone has any ideas.

This thread has been quiet for a long time now. But, I just started hacking away at the original request in the latest firmware (Shut off HVAC after 5 minutes of open sensors.)

Does anyone else still have an interest in this? If so, let me know and I can clean up and post my code if others are willing to test.

The turn off HVAC if the door is open for 5 minutes is the reason I bought a Vera 5 years ago. It worked fine with UI5, then my VeraLite died and I replaced it with a VeraEdge running UI7. I cannot get the original plugin to create a device to control the thermostat. My knowledge of lua code is limited.
Any help would be greatly appreciated.

I created a device, however there is no interface that allows me to specify the sensors that control the thermostat. In UI5 you could declare which sensors would trigger the thermostat to turn off. I cant find the inputs for the door sensors.

Any help?

Did you try Reactor?

Not familiar w/ Reactor. Does it cover this kind of situation (IFTT)?

Yes but not thru IFTTT. It is a Vera plugin available under apps. Reactor lets you set up conditions and when the condition or conditions become true or false reactor can respond with an activity that you specify.

Indeed, i also use Reactor to act on a door that is not closed in 60 seconds. I set it up by using these tips:

1 Like

Thank you for the help. I will look into this ASAP.

Ok, ready to try this live and without a net.

Trying to set up turning off the AC if either the living room door or the bedroom door are open. Using an OR condition to check the doors, I only want the AC to come back on if both doors are closed. Should I latch one or both sensors?

No, it takes care of itself. If both doors are open, the group is true. If either door is open, the group is true. If both doors are closed, then and only then can the group go false.

Might look something like this:

  • Root group - AND or NUL operator
    • Group “Any Door Open” – OR operator
      • Device state, door #1 open (e.g. door sensor device Tripped variable is TRUE)
      • Device state, door #2 open
    • Group “AC Control” – AND operator
      • Group state condition, current ReactorSensor, group “Any Door Open” + options “sustained for” 30 seconds and “delay reset” 30 seconds (set the delays to your sensibilities–these are examples).

Activities:

  • “AC Control is TRUE” - device action to turn off the AC unit
  • “AC Control is FALSE” - device action to turn on the AC unit

The use of the “sustained for” delay on the group state condition allows a door to opened briefly without turning off the AC (just passing through). Likewise, the use of “delay reset” means the doors have to stay closed to allow the AC to be turned back on. This dampens the switching action a little and prevents banging your AC on and off in time with the swing of the door (which may short-cycle compressors, etc).

You may need to use the variable/expression tricks in this video to save and restore the operating mode of the AC unit if you are doing it by controlling a multi-mode thermostat. But if it’s a simple on/off control or a thermostat only switching between OFF and COOL then you don’t need to do that, just set the state/mode of the AC control directly.

1 Like

Thanks for the help. Saw your video and I am using it to set this up. Don’t want to make a mistake as it’s in a vacation rental that is 300 miles away and booked for the rest of the summer. I am treading very carefully.
Excellent video by the way. Thanks for posting.

Trying to follow the video to set LastState before AC shuts down. Cannot find SetVariable as an option when trying to get the thermostats current state. Chose the reactor Sensor but SetVariable is not an option. Using Reactor 3.2
Did something change or am I doing it wrong?

SetVariable is an action on the ReactorSensor, not the thermostat.

OK. I chose the Reactor device, not the name of the reactor device (which is named DoorSensor).
Thanks for the help.