Boolean statement will not change

Hi Folks -
I am new to this and trying to learn some new thing. I am trying to make a silly little rule that will say welcome when i enter the office and not repeat for a set time. I tried to set a delay with a boolean action. here is what i have:

IF (Time between 6:01 PM EDT and 12:00 AM EDT(T) AND
Private Boolean is true(F) [FALSE]) THEN
Set Private Boolean False
Speak on Office speaker: 'Good Evening....Welcome to the office....please enjoy your evening....please let me know if i can be of assistance'
Delay 0:05:00
Set Private Boolean True
END-IF

It seems that no matter what i do, the first boolean statement will never turn true. If i remove the statement altogether, then every time i move in my chair, the message will run.

What do i have wrong here?

Thanks for all your help!

What do the logs show?
Also you could do this with the notifications app which would be easier.

The problem with Private Boolean is if it gets into a state you don't want you need a second rule to change it. I would replace the Private Boolean with a local boolean variable. You can see the value of a local variable and change it easily.

You set it back to TRUE within the IF statement. So you will go into the if statement if it's true, then you'll set it to false, speak on the speaker, then set it back to true. Since it's false by default, you'll never enter your IF statement to set it to true.

What you can go is go into the rule, then click on the variables and edit it to set it to true.

The way your rule runs, it will always be true by the end of the rule, so why are you using it? Just use the time function

Better question, what are you trying to accomplish?

Notifications are definitely the cleaner way to do this. A quick mock up:

Edit: Adding the time restraint.

image

1 Like

Hi folks - Wow thank you ALL for the tremendous response. Funny, you don't know what you don't know. Never heard of the Notification App but that is why you ask the silly questions! The Notification App is exactly what I am looking for. Thanks to @at9, @pseudonym & @lairdknox for all the valuable information.

@dadarkgtprince, Thanks for the info! I was trying to figure out what state the private boolean was in to start with. No matter what i did it would not change. thanks for clearing that up. To answer your question about what i was trying to accomplish, basically knowledge. While this silly experiment was for nothing other than to see if i could get it to do one thing one time and ignore other motion, it was knowledge for bigger and better plans down the road. Your information really helped!

and thanks @at9 for the example! I would have hunted for days for that thing!

Thanks again to everyone!

1 Like