Trying to Figure Out an Automation

Originally posted this is the Core thread, but didn’t get an answer:

If someone manually changes the temperature on my Nest thermostat while any of my windows are open, I’d like my R1 speaker to make an announcement that a window is open. If it could say which window(s) are open that would be even better.

If anyone has done this is Core/Webcore and could share a code, I’d appreciate it.

Easy… for condition choose thermostat. then attribute setpoint. then comparison - changes. and add another condition if any window open

create this same rule for each window

I don’t have a speaker so change log to console to your speak text and use the expression I set up. All you need to do is edit the windows variable with your windows contacts.

Then if your cooling setpoint changes and you have any open windows it will speak/log to console “The kitchen window is open” or if multiple it will be “Thr kitchen window, bedroom window, and living room window are open”

Thanks Dustin, does import from code not work yet?

Use the orange restore button. Import is something different.

Got it, entered my sensors, but when I try to change “Log to Console” I don’t see an option for “Speak Text”?

You need to change the device to your speaker. Copy the expression I wrote out. Click add new action. Find your speaker select the speak text. Change value to expression and paste. Save and then you can get rid of the log to console if you want.

1 Like

Does this look correct? It doesn’t seem to be working…

You might try Speak and Resume. I see that a lot around the forums.

Also turn your logging level to full and paste those in here after trying the above. You also do not need to use the red snapshot button. Green shows me the info that I need to see.

OK thanks, heres the full log, it looks like it worked but I didn’t hear anything:

+1ms ╔Received event [Nest Thermostat - Nest].coolingSetpoint = 71 with a delay of 47ms
+71ms ║RunTime Analysis CS > 9ms > PS > 28ms > PE > 34ms > CE
+79ms ║Runtime (38637 bytes) successfully initialized in 28ms (v0.2.0d9.20170714) (77ms)
+79ms ║╔Execution stage started
+86ms ║║Comparison 71.0 changes = true (1ms)
+87ms ║║Cancelling condition #4’s schedules…
+87ms ║║Condition #4 evaluated true (4ms)
+123ms ║║Comparison open is open = true (1ms)
+125ms ║║Comparison open is open = true (1ms)
+126ms ║║Comparison closed is open = false (1ms)
+127ms ║║Comparison closed is open = false (1ms)
+129ms ║║Comparison closed is open = false (1ms)
+130ms ║║Comparison closed is open = false (1ms)
+132ms ║║Comparison open is open = true (0ms)
+133ms ║║Comparison closed is open = false (1ms)
+134ms ║║Comparison open is open = true (1ms)
+136ms ║║Comparison closed is open = false (0ms)
+142ms ║║Condition #5 evaluated true (55ms)
+143ms ║║Cancelling condition #1’s schedules…
+143ms ║║Condition group #1 evaluated true (state changed) (60ms)
+145ms ║║Cancelling statement #2’s schedules…
+152ms ║║Calculating (integer) 4 > (integer) 1 >> (boolean) true
+159ms ║║Calculating (string) The + (string) Door Back Porch Slider Left, Door Front Porch Slider, Window Bedroom Driveway and Window Jack’s Room Front >> (string) The Door Back Porch Slider Left, Door Front Porch Slider, Window Bedroom Driveway and Window Jack’s Room Front
+161ms ║║Calculating (string) The Door Back Porch Slider Left, Door Front Porch Slider, Window Bedroom Driveway and Window Jack’s Room Front + (string) are >> (string) The Door Back Porch Slider Left, Door Front Porch Slider, Window Bedroom Driveway and Window Jack’s Room Front are
+162ms ║║Calculating (string) The Door Back Porch Slider Left, Door Front Porch Slider, Window Bedroom Driveway and Window Jack’s Room Front are + (string) open. >> (string) The Door Back Porch Slider Left, Door Front Porch Slider, Window Bedroom Driveway and Window Jack’s Room Front are open.
+278ms ║║Executed physical command [Upstairs R1].playTextAndResume([The Door Back Porch Slider Left, Door Front Porch Slider, Window Bedroom Driveway and Window Jack’s Room Front are open.]) (113ms)
+279ms ║║Executed [Upstairs R1].playTextAndResume (114ms)
+281ms ║╚Execution stage complete. (201ms)
+290ms ╚Event processed successfully (290ms)

Everything appears to be right for this. Assuming the volume is up on your speaker and it is turned on. I do not know what else to trouble shoot for that.

Actually, it just worked, with a delay of about 5 minutes. Is that normal?

I would say no but it might have just needed to cache some things. Or smartthings could be delayed right now.