1) Give a description of the problem
I have a piston that sends a push notification when someone changes a thermostat’s temperature. I also have pistons that automatically set the temperature when I leave or when it’s a certain time of the day. These also send push notifications (e.g., “Temp was set to 60° because you left”). The end result is I get two simultaneous notifications, one when the piston sees the setpoint change and another notification generated by the piston that initiated the change. I don’t want two notification so I tried to use a global variable to determine whether or not to send the notifications from the piston that reacts to any setpoint change. I thought I could create a piston that would set a global “sendNotification?” boolean variable to false, change the temp when my presence changes to away, and then set the "sendNotifications? boolean to true. Of course, this didn’t work because the pistons don’t run at the same time. So the sendNotication flag gets set to false, the temp gets change, the sendNotification gets set to true and then the other piston that watches for setpoint changes runs and the sendNotification flag has already been set to true again and it generates a “setpoint was changed” notification.
Has anyone found themselves with a similar need and successfully addressed it?
2) What is the expected behavior?
I want to somehow have a piston tell other pistons not to send a push notification under certain circumstances.
3) What is happening/not happening?
I can’t figure out the logic needed to temporarily tell other pistons to not send notifications.
4) Post a Green Snapshot of the piston
Here’s what I tried. It wasn’t working and after a “Doh!” moment I realized why.
5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)