Trying to send alert if HVAC on and contacts open


#1

1) Give a description of the problem
Trying to send an alert when HVAC kicks on and windows/doors have been open for X minutes.

2) What is the expected behavior?
See above.

3) What is happening/not happening?
It’s not sending the notification.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
11/5/2017, 1:15:46 PM +129ms +1ms ╔Received event [Thermostat].nestThermostatOperatingState = idle with a delay of 2771ms +112ms ╚Event processed successfully (112ms) 11/5/2017, 1:03:46 PM +702ms +1ms ╔Received event [Thermostat].nestThermostatOperatingState = cooling with a delay of 2259ms +137ms ╚Event processed successfully (137ms) 11/5/2017, 12:51:46 PM +967ms +1ms ╔Received event [Thermostat].nestThermostatOperatingState = idle with a delay of 2639ms +102ms ╚Event processed successfully (102ms) 11/5/2017, 12:36:46 PM +373ms +1ms ╔Received event [Thermostat].nestThermostatOperatingState = cooling with a delay of 3019ms +147ms ╚Event processed successfully (147ms) 11/5/2017, 12:29:29 PM +401ms +1ms ╔Received event [Sliding Glass Door].contact = closed with a delay of 84ms +164ms ╚Event processed successfully (164ms)


#2

Try using a trigger for the A/C unit - “changes to not idle”


#3

The problem is that I’d like for it to be constantly evaluated. If I used ‘changed’ it wouldn’t alert me if I left a door open after the HVAC turned on.


#4

If [HVAC is on
and
contacts change to open]
OR
[HVAC changes to on
AND
contacts are open] then
Do

It’s early still, this work?


#5

Change the IF to a WHILE.
This way while the hvac is on it will continuously cycle through every minute while the window is open.
When you close the window it stops.


#6

Odd. I tried both suggestions, but neither are working. At all. I don’t even see the contact opening and closing in the piston log (but I do see it in ST). Here are the ones I tried:


#7

Update to the latest version of webCoRE.


#8

Got it working by updating webCoRE. One final question, how can I list what contact is open in the notification?


#9

Use $currenteventdevice to provide the name.


#10

Hmm, what does that look like, because this isn’t it. I also tried it with braces around it, but that was wrong too.


#11

Create device variable. Leave it empty.

Click on the any windows open condition. Click the cog and select save matching device list to variable. Choose your variable created above.

Use this variable in your message


#12

Is there a final example of all of that already done?


#13

I don’t use it anymore, so you’ll note the broken devices, but the logic still works.


#14

How do I make it send the notification only, say, once an hour? Right now, it seems to send it as often as long as the ‘wait’ period in the ‘do’ section. I had mine with just “wait 1 second” before sending the notification, and I got a long series of them.

I added a “wait 1 hour” after sending that notification… is that sufficient?


#15

If your “notification” is in the same spot as the speak command, you can change the last WAIT to 60 minutes…


#16

Yes, that’s what I did.

I’m now trying to figure out how to do a few more things:

  • Using the Doors and Windows variables in the “Any” (I’ve actually also got them set up as global variables: @Doors, @Main_Floor_Windows, @Upstairs_Windows). I’ve got two copies of this piston, since I have separate HVAC for the main floor and upstairs.
  • Adapt @flyize’s code above for the “save matching devices”

#17

It still baffles me why people keep storing devices in @globals

I can assure you, it does not do what you wish it did…


… be that as it may…

index


#18

I didn’t know. I saw other references to it. I just wanted one place to update the list of devices that would be used by multiple pistons.

Getting rid of the @globals (which I just did), how do I use the ‘Windows’ device list in the Any clause?


#19

Summarized so perfectly by @c1arkbar

(the parenthesis and curly brackets are my additions)


#20

I’m just trying to use the variable for the list of devices in the Any. I finally figured it out… I just needed to scroll down further in the Edit Condition box to where it listed my local variables, and select those instead of the actual physical devices.
image