Statement type?


#1

Hi all I have looked all over the the builder what statement type are these in the piston builder
set Interval as “LastTriggeredTime” - $now and set “LastTriggeredTime” = $now .

set “Duration” as $now - LastTriggeredTime.


#2

What statement type? Those look like they’re just “Set Variable” to me, if that’s what you mean? The last one has some math to it so you’d have to change the blue dropdown box (I think it’s defaulted to Value) to Expression.


#3

here is where it came from I tried to do example but I am not sure i did it correct


#4

You’d have to post a green snapshot of your piston for me to help.


#5

What i went is date an time it started how long on then put that in 1 email
and a way to track time between


#6

This should do what you want:


#7

This piston above will send an e-mail with this in it (I logged to console to get this sample):

image


#8

it woks but when i do email i get 2 every time any idea?


#9

Can you turn logging on full, let the piston execute and send an email, then post up the logs? Can fix it then.


#10

i test it today and it was ok thanks for the help


#11

Hi michicago,
I been looking at going the next step on this code I like to track the time between off and on how would you go about that ?