Piston Help - send email - THANKS!

variables

#1

1) Give a description of the problem
The email is sending the names of all the devices without the temperature and regardless of the IF statement.

2) What is the expected behaviour?
The email should send only the devices that meet the criteria of the IF statement with the name of the device and the heatingSetpoint.

3) What is happening/not happening?
I am receiving an email with all of the devices, and no heatingSetpoint.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full

11/11/2020, 11:20:18 AM +102ms
+0ms â•”Received event [SmithRidge].time = 1605111619285 with a delay of -1184ms
+119ms â•‘RunTime Analysis CS > 32ms > PS > 72ms > PE > 16ms > CE
+122ms â•‘Runtime (40313 bytes) successfully initialized in 72ms (v0.3.110.20191009) (121ms)
+123ms â•‘â•”Execution stage started
+131ms â•‘â•šExecution stage complete. (9ms)
+133ms â•‘Setting up scheduled job for Wed, Nov 11 2020 @ 11:25:19 AM EST (in 301.051s)
+141ms â•šEvent processed successfully (141ms)
11/11/2020, 11:15:19 AM +428ms
+1ms â•”Received event [SmithRidge].time = 1605111319285 with a delay of 143ms
+94ms â•‘RunTime Analysis CS > 27ms > PS > 52ms > PE > 15ms > CE
+96ms â•‘Runtime (40310 bytes) successfully initialized in 52ms (v0.3.110.20191009) (94ms)
+97ms â•‘â•”Execution stage started
+106ms â•‘â•šExecution stage complete. (9ms)
+107ms â•‘Setting up scheduled job for Wed, Nov 11 2020 @ 11:20:19 AM EST (in 299.75s)
+113ms â•šEvent processed successfully (113ms)
11/11/2020, 11:14:50 AM +17ms
+0ms â•”Received event [SmithRidge].test = 1605111290016 with a delay of 0ms
+119ms â•‘RunTime Analysis CS > 22ms > PS > 62ms > PE > 36ms > CE
+122ms â•‘Runtime (40309 bytes) successfully initialized in 62ms (v0.3.110.20191009) (120ms)
+123ms â•‘â•”Execution stage started
+205ms â•‘â•‘Comparison (decimal) 68.0 is_greater_than_or_equal_to (integer) 67 = true (2ms)
+208ms â•‘â•‘Comparison (decimal) 68.0 is_greater_than_or_equal_to (integer) 67 = true (1ms)
+210ms â•‘â•‘Comparison (decimal) 68.0 is_greater_than_or_equal_to (integer) 67 = true (1ms)
+213ms â•‘â•‘Comparison (decimal) 68.0 is_greater_than_or_equal_to (integer) 67 = true (1ms)
+215ms â•‘â•‘Comparison (decimal) 68.0 is_greater_than_or_equal_to (integer) 67 = true (1ms)
+223ms â•‘â•‘Condition #2 evaluated true (81ms)
+224ms â•‘â•‘Condition group #1 evaluated true (state did not change) (83ms)
+227ms â•‘â•‘Cancelling statement #5's schedules...
+238ms â•‘â•‘Calculating (string) Empty device list + (string) - >> (string) Empty device list -
+244ms â•‘â•‘Calculating (string) Empty device list - + (string) Smith HW Tstat-Bd 1, Smith HW Tstat-Bd 3, Smith HW Tstat-Bd 7, Smith HW Tstat-Bd 8 and Smith HW Tstat-Dng rm >> (string) Empty device list - Smith HW Tstat-Bd 1, Smith HW Tstat-Bd 3, Smith HW Tstat-Bd 7, Smith HW Tstat-Bd 8 and Smith HW Tstat-Dng rm
+4006ms â•‘â•‘Executed virtual command sendEmail (3759ms)
+4028ms â•‘â•šExecution stage complete. (3905ms)
+4032ms â•‘Setting up scheduled job for Wed, Nov 11 2020 @ 11:15:19 AM EST (in 25.237s)
+4040ms â•šEvent processed successfully (4040ms)

#2

I imported your piston to review more closely. Not to over state the obvious but I’m assuming you moved the IF out of the Every block so that you could test.

In order to include temperature, you will have to adjust the coding and your expression within the email task. I would expect the current expression devicestoCheck + ' - ' + devicesHigh to return only the two lists of devices.

I tweaked the piston a bit
-Updated the devicesHigh to a string variable
-devicesHigh is cleared prior to each run
-each device is individually evaluated, if greater than the defined setpoint, it is added to the devicesHigh list in the format of device1 : device1’s setpoint, device2 : device2’s setpoint, etc
-As long the deviceHigh list is not blank, then the email will be sent with the deviceHigh variable as the body.


#3

Thanks so much! We are much closer! Now I am getting the names of all of the devices and the temp of the 1 tstat I know is above the IF statement.


#4

Hey there, just wondering if you have any other suggestions? It seems I am getting the name of every thermostat for the 1 tstat that is above the IF statement. Thanks so much!


#5

hmm, unfortunately I only have 1 thermostat so testing is a little difficult. Do you have any logs to share?

For testing purposes, I replaced heatingSetpoint with temperature, so in theory it would send me all devices with actual temp > 67. The test worked as designed and I let it execute twice to make sure the variables were being set correctly. (Also changed email to a push message)

Are all your thermostats using the same device handler? If not, I am wondering if heatingSetpoint is called something else in the other thermostats.


#6

Yes, same device handler. here is the log - Thanks!

11/16/2020, 4:50:53 PM +277ms
+0ms â•”Received event [SmithRidge].test = 1605563453276 with a delay of 1ms
+111ms â•‘RunTime Analysis CS > 17ms > PS > 62ms > PE > 31ms > CE
+114ms â•‘Runtime (42072 bytes) successfully initialized in 62ms (v0.3.110.20191009) (112ms)
+115ms â•‘â•”Execution stage started
+139ms â•‘â•šExecution stage complete. (25ms)
+141ms â•‘Setting up scheduled job for Mon, Nov 16 2020 @ 4:55:51 PM EST (in 297.98s)
+150ms â•šEvent processed successfully (150ms)
11/16/2020, 4:50:51 PM +39ms
+1ms ╔Starting piston… (v0.3.110.20191009)
+186ms ║╔Subscribing to devices…
+329ms ║║Subscribing to Smith HW Tstat-Bd 1…
+331ms ║║Subscribing to Smith HW Tstat-Bd 3…
+332ms ║║Subscribing to Smith HW Tstat-Bd 7…
+333ms ║║Subscribing to Smith HW Tstat-Bd 8…
+334ms ║║Subscribing to Smith HW Tstat-Dng rm…
+335ms â•‘â•šFinished subscribing (151ms)
+399ms â•‘Comparison (dynamic) Empty device list is_greater_than_or_equal_to (integer) 67 = true (2ms)
+411ms â•‘Comparison (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, is_not (dynamic) null = true (1ms)
+421ms â•‘Setting up scheduled job for Mon, Nov 16 2020 @ 4:55:51 PM EST (in 299.938s)
+452ms â•šPiston successfully started (450ms)


#7

Looks like that is a log after manually executing via test button. Can you post a log after the piston executes itself at the 5min interval.


#8

Ooops, sorry about that! Here you go -

11/18/2020, 8:52:57 AM +600ms
+1ms â•”Received event [SmithRidge].time = 1605707578449 with a delay of -849ms
+149ms â•‘RunTime Analysis CS > 41ms > PS > 74ms > PE > 34ms > CE
+152ms â•‘Runtime (42075 bytes) successfully initialized in 74ms (v0.3.110.20191009) (150ms)
+153ms â•‘â•”Execution stage started
+163ms â•‘â•‘Cancelling statement #14's schedules...
+168ms â•‘â•‘Executed virtual command setVariable (2ms)
+176ms â•‘â•‘Cancelling statement #5's schedules...
+185ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 + (string) : >> (string) Smith HW Tstat-Bd 1:
+210ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1: + (string) 68 >> (string) Smith HW Tstat-Bd 1:68
+214ms â•‘â•‘Smith HW Tstat-Bd 1:68
+215ms â•‘â•‘Executed virtual command log (2ms)
+238ms â•‘â•‘Comparison (dynamic) 68.0 is_greater_than_or_equal_to (integer) 67 = true (1ms)
+240ms â•‘â•‘Condition #2 evaluated true (21ms)
+241ms â•‘â•‘Condition group #1 evaluated true (state did not change) (23ms)
+244ms â•‘â•‘Cancelling statement #18's schedules...
+256ms â•‘â•‘Calculating (string) + (string) Smith HW Tstat-Bd 1 >> (string) Smith HW Tstat-Bd 1
+261ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 + (string) : >> (string) Smith HW Tstat-Bd 1 :
+279ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : + (string) 68 >> (string) Smith HW Tstat-Bd 1 : 68
+283ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68 + (string) , >> (string) Smith HW Tstat-Bd 1 : 68,
+290ms â•‘â•‘Executed virtual command setVariable (4ms)
+301ms â•‘â•‘Cancelling statement #5's schedules...
+311ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 3 + (string) : >> (string) Smith HW Tstat-Bd 3:
+338ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 3: + (string) 68 >> (string) Smith HW Tstat-Bd 3:68
+344ms â•‘â•‘Smith HW Tstat-Bd 3:68
+346ms â•‘â•‘Executed virtual command log (3ms)
+372ms â•‘â•‘Comparison (dynamic) 68.0 is_greater_than_or_equal_to (integer) 67 = true (2ms)
+373ms â•‘â•‘Condition #2 evaluated true (23ms)
+375ms â•‘â•‘Condition group #1 evaluated true (state did not change) (24ms)
+378ms â•‘â•‘Cancelling statement #18's schedules...
+388ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68, + (string) Smith HW Tstat-Bd 3 >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3
+392ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 + (string) : >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 :
+412ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : + (string) 68 >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68
+417ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68 + (string) , >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,
+422ms â•‘â•‘Executed virtual command setVariable (3ms)
+432ms â•‘â•‘Cancelling statement #5's schedules...
+442ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 7 + (string) : >> (string) Smith HW Tstat-Bd 7:
+466ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 7: + (string) 68 >> (string) Smith HW Tstat-Bd 7:68
+472ms â•‘â•‘Smith HW Tstat-Bd 7:68
+473ms â•‘â•‘Executed virtual command log (2ms)
+500ms â•‘â•‘Comparison (dynamic) 68.0 is_greater_than_or_equal_to (integer) 67 = true (2ms)
+502ms â•‘â•‘Condition #2 evaluated true (25ms)
+504ms â•‘â•‘Condition group #1 evaluated true (state did not change) (26ms)
+507ms â•‘â•‘Cancelling statement #18's schedules...
+520ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68, + (string) Smith HW Tstat-Bd 7 >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7
+525ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 + (string) : >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 :
+543ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : + (string) 68 >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68
+546ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68 + (string) , >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,
+552ms â•‘â•‘Executed virtual command setVariable (3ms)
+560ms â•‘â•‘Cancelling statement #5's schedules...
+569ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 8 + (string) : >> (string) Smith HW Tstat-Bd 8:
+590ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 8: + (string) 68 >> (string) Smith HW Tstat-Bd 8:68
+594ms â•‘â•‘Smith HW Tstat-Bd 8:68
+595ms â•‘â•‘Executed virtual command log (2ms)
+616ms â•‘â•‘Comparison (dynamic) 68.0 is_greater_than_or_equal_to (integer) 67 = true (1ms)
+618ms â•‘â•‘Condition #2 evaluated true (20ms)
+619ms â•‘â•‘Condition group #1 evaluated true (state did not change) (21ms)
+621ms â•‘â•‘Cancelling statement #18's schedules...
+630ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68, + (string) Smith HW Tstat-Bd 8 >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8
+634ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 + (string) : >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 :
+648ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : + (string) 68 >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68
+651ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68 + (string) , >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,
+657ms â•‘â•‘Executed virtual command setVariable (4ms)
+666ms â•‘â•‘Cancelling statement #5's schedules...
+674ms â•‘â•‘Calculating (string) Smith HW Tstat-Dng rm + (string) : >> (string) Smith HW Tstat-Dng rm:
+696ms â•‘â•‘Calculating (string) Smith HW Tstat-Dng rm: + (string) 68 >> (string) Smith HW Tstat-Dng rm:68
+700ms â•‘â•‘Smith HW Tstat-Dng rm:68
+701ms â•‘â•‘Executed virtual command log (2ms)
+722ms â•‘â•‘Comparison (dynamic) 68.0 is_greater_than_or_equal_to (integer) 67 = true (1ms)
+724ms â•‘â•‘Condition #2 evaluated true (20ms)
+725ms â•‘â•‘Condition group #1 evaluated true (state did not change) (21ms)
+728ms â•‘â•‘Cancelling statement #18's schedules...
+738ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68, + (string) Smith HW Tstat-Dng rm >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm
+741ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm + (string) : >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm :
+759ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : + (string) 68 >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68
+762ms â•‘â•‘Calculating (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68 + (string) , >> (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68,
+768ms â•‘â•‘Executed virtual command setVariable (4ms)
+776ms â•‘â•‘Comparison (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, is_not (dynamic) null = true (1ms)
+778ms â•‘â•‘Condition #13 evaluated true (5ms)
+779ms â•‘â•‘Condition group #12 evaluated true (state did not change) (7ms)
+781ms â•‘â•‘Cancelling statement #16's schedules...
+792ms â•‘â•‘Calculating (string) These devices are out of range: + (string) Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, >> (string) These devices are out of range: Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68,
+795ms â•‘â•‘Calculating (string) These devices are out of range: Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, + (string) as of >> (string) These devices are out of range: Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, as of
+799ms â•‘â•‘Calculating (string) These devices are out of range: Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, as of + (string) Wed, Nov 18 2020 @ 8:52:58 AM EST >> (string) These devices are out of range: Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, as of Wed, Nov 18 2020 @ 8:52:58 AM EST
+802ms â•‘â•‘Calculating (string) These devices are out of range: Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, as of Wed, Nov 18 2020 @ 8:52:58 AM EST + (string) >> (string) These devices are out of range: Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68, as of Wed, Nov 18 2020 @ 8:52:58 AM EST
+804ms â•‘â•‘Executed virtual command setState (1ms)
+1861ms â•‘â•‘Executed virtual command sendEmail (1052ms)
+1864ms â•‘â•‘Cancelling statement #20's schedules...
+1870ms â•‘â•šExecution stage complete. (1717ms)
+1884ms â•‘Setting up scheduled job for Wed, Nov 18 2020 @ 8:57:58 AM EST (in 298.966s)
+1892ms â•šEvent processed successfully (1892ms)

#9

Thanks, so maybe I am confused as to what is happening vs what you expect. According to the logs, the pistons is evaluating each thermostat as expected. The resulting string states 68 as the set point for each because that is what the piston sees for each device (it is not reading only the first). The final string is:

Smith HW Tstat-Bd 1 : 68,Smith HW Tstat-Bd 3 : 68,Smith HW Tstat-Bd 7 : 68,Smith HW Tstat-Bd 8 : 68,Smith HW Tstat-Dng rm : 68

If they are not all set to 68 then that is a different problem.


#10

So only 1 of 5 tstats is set to 68. The others are set to all different temps. So technically only 1 should show. The goal is to show tstats that are set over 68.


#11

Just as a test, I’d like to see what ST is reporting the set point to be…in the evaluation console, try pulling the set point for one of the other thermostats

for example:
[Smith HW Tstat-Bd 3 : heatingSetpoint]


#12

BINGO - (expression) [Smith HW Tstat-Bd 3 : heatingSetpoint] »»» (decimal) 68. Although, I shouldn’t be so happy, now I have to figure out on the ST side how to make it play nice. Thanks so much for your help!!!


#13

Good luck :grin:


#14

All set. Thanks again!!!