Make a piston only trigger once a day


#1

Sorry I’m very new to this, I’m basically trying to figure out a way to make sure a piston only triggers once a day, even if the same events occur. So for example the first person who opens the door to my office in the morning gets greeted with ‘‘good morning’’ from Alexa. How do I stop Alexa from repeating this everytime someone opens the door? TIA


#2

You can use timers
Every day at 7pm
do this do that

My bad… I didn’t read the whole post sorry…

If the time frame is set it will be an easier piston,

IF the door sensor changes to open
AND
IF time is between x and y
Then
Say text “bla bla”

This one works only IF the first person walks in for sure between 9.00am and 9.05 and everbody else walk in at 9.30am and after…

If this is not the case, we will need to use variables.

IF door sensor changes to OPEN
AND 
IF variable greeting = true
Then
Say text "bla bla"
Set variable greeting to = false

IF time is (very early in the morning, lets say 5am)
Set variable greeting = true

#3

Hi,
You can use a variable (e.g announced) only speak if announced is false, and set it to true once the announcement has been made. You’ll also need to set it back to false at the end of the day.


#4

Would I be able to get more info on how to do the second one? I’m a little bit confused about how to set a variable.


#5

let’s do this,
in a couple of hours I’ll write the piston and post it here, you can directly downloaded with variable already setup and you can analize it…


#6

here it is…


#7

I make use of the $day variable, having defined an integer variable “lastDay”

Logic:
if lastDay is different than $Day, then do…
. blah blah
set variable lastDay = $day

Cheers


#8

ahh unbelievable! Thank you so much for this, I completely get it now!