Piston Triggering Twice?

variables
triggers

#21

I wouldn’t assume that. It appears to me to be a WebCore issue. I get duplicate messages every time. How can I fix this. Otherwise I’m going to have to remove the piston and come up with an alternative.


#23

The only way I was able to get this to not repeat twice was to create a variable to see if the piston had fired. But I also had to have changing that variable as the very first action or it didn’t work.


#24

I am having a piston firing twice, but no matter what I have tried it still happens. Below is my piston. Any help would be welcome. I added the delay after hoping that would help but no luck.


#25

Well, are two of your dimmer changing to off? This will trigger if any of the dimmer change to off, so if two of them change to off, I would expect it to trigger twice. You say it’s triggering twice but you don’t say how far apart or what else was going on. There’s nothing in this piston that would prevent it from trigger 1,000 times if the dimmer turned off that many times. What were you expecting to happen and what was going on with your devices at the time?


#26

OK here is the layout: There are two spaces in an open concept. The Family room with a Lamp and high hats. Then the living room with the lamp and a plug. In each room I turn on both devices at the same time. But not necessarily both rooms together. So how do I write the piston for this?

I want the text line to speak when the family room or living room turns off. The double speech happens about 5 or 6 seconds apart. I have a similar Piston for On as well. Example: If I turn on the family rooms both lights with one command with Alexa group the speaker says the line, then sometimes it doesn’t say the command again but sometimes one instance plays then 5 second or so later a second instance. Now if I turn the room off within seconds of turning on, the next time I turn it on I get the on text then the off text from the previous secession within a few seconds.


#27

Try changing your task cancellation policy to never. Then it should wait for the timeout before running again. As long as you leave the parallelism to default it won’t run two instances at the same time.


#28

Ryan, I turned TCP to never, I hope that helps. Thanks.


#29

OK, Ryan you are correct each switch mentioned fires the speak command. So now how do I correct the piston so it will work for both rooms, and two lights in each room?


#30

Write two separate pistons :wink:

And make your trigger require both lights turned off.


#31

OK I made a piston for ON and Off but it doesn’t fire. I think there is a timing problem. This is the one for ON.


#32

Chance your conditions from “changes to on” to “is on”. The way it’s written now, it only would evaluate true if both switched changed at the exact same time (which would be never).


#33

Thanks, I will try that.


#34

I tried it and it fires, but the speak command fires twice one for each switch. Below is the Piston.


#35

Can you post the logs? Because if one switch is off the whole thing should be false.

Try moving the wait to after the speak and change it to 2 seconds. You don’t have the old piston still in there too, do you?

Try changing the spoken text to make sure it’s really triggering twice.


#36

I will do as you say. I don’t have the original running during testing. The wait that is “0” is something needed to prevent clipping of the first command. But I will leave it at 0 and add one of 2 seconds after. Below is the new Piston before testing.


Here is the logs, repeated three times…



#37

When you say repeated 3 times, you didn’t get 3 notifications. The piston has to execute to evaluate the conditions, that why the piston fires 3 times. Only one of those executed an action. How many notifications from your speaker did you get?
And I don’t understand why you need the wait before the speak command. It cuts something off? That shouldn’t be either. The wait has nothing to do with the speak. I would remove the wait before the speak command, I believe it’s causing unnecessary rescheduling.


#38

I received two notifications one directly behind the first.


#39

Did you try taking the wait zero out. That is part of the problem I think. I don’t understand why you have it.


#40

Yes it is removed, and I will test tomorrow. The reason I have it in is because I use Echosistant which has a canned responce. Example: If I say “Alexa turn on all the lights in the family room” Her response is “OK” then “Do you need anything else” So many times the Speak command in my piston will fire as the last part of the Do you need anything else, so even if I answer “NO” imedetaly it gets partially cut off.


#41

OK after testing with the time delay at end it seems to work. I also kept the delay at 2 second in front. The true test is when ST is loaded, that is when I see most problems with any automation. Thank you for your help, it is most appreciated.