Announcements Happening When They Shouldnt be


#1

1) Give a description of the problem
So I have a multitude of Pistons set up to make announcements when my doors open. Everything is working fine with the opening part. But then if the door closes a minute or two later, it is making another announcement, that the door is opened. When it was really just closed.

2) What is the expected behavior?
I want the announcement to happen when the door opens only. Not when it is closing.

3) What is happening/not happening?
An announcment is happening when the door opens, and then if it is closed a few minutes later, it is making another announcement.

**4) Post a Green Snapshot

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

REMOVE BELOW AFTER READING


Override help for echo speaks door is open piston
#2

I don’t use ELSE (don’t know why:))) I always use multiple IFs instead. But if i am not mistaken (please correct me people if i am wrong) line #47 ELSE and following SPEAK might be causing that. Try by removing everything after ELSE.
Plus: You are pausing THIS piston from THIS piston and you are executing another piston that RESUMES THIS piston am I correct?
IF so, this might make things a bit complicated.

Test my suggestion first.
Or if you share what wou want to accomplish with you piston A to Z, I believe it can be done in a single piston which would be better. I’ll do my best to write a piston for it.
My setup used to be 3-4 pistons doing a task and now almost everything is down to a single piston and efficency is much better.


#3

ike, I am going to go try your first option now. But to respond to why I am pausing this piston, it was an attempt at me to prevent it from duplicating the announcement when I close the door; which works if I close the door within a minutes time.

But if I leave the door open an extended period of time, then close it…It makes the “Back door opened announcement” again, even though I just closed the door.

Basically, what I am trying to do, i just have all of my contact sensors, make a random announcement when the contact is opened, based on temperature outside. Right now, line 47 is supposed to be when the weather is just middle temp outside, not cold or not hot. So just basic Speak commands.

I am going to go try out your first suggestions.


#4

ok great… sound like a very simple setting…
While you try that let me write a very simple piston for it… then we’ll test that if you like it better.


#5

Thanks, this is driving me nuts…I been opening and closing my doors all day testing this…My wife is going to strangle me.

If I take out the else statement, nothing happens, because the conditions are not met. Right now it is about 50 degrees here, so I would be in the middle temperature…


#6

Ok here it is @Philpan ,

I used a single TRIGGER and three CONDITIONS…
when the door changes to OPEN the piston will check all conditions…
which ever is the case, it will trigger that one…
(You can go even simpler than this but this one will do it for now I believe)

you can download this with the code.


#7

Ok I am going to give this a go…I have never downloaded code before. So I am going to figure this out…


#8

Select NEW piston…
Choose RESTORE PISTON FROM BACKUP CODE
Enter 2p2sr (which is my pistons code)
replace matching devices according to your system.

Or you can simple re-write this one.


#9

Ok got it up and running. I cant thank you enough. I do believe it has stopped the duplicating after a few tests.

Not my next instance would be to add multiple to contact sensors to this? What would be the best practice to do this?


#10

I am glad it worked…
I know the feeling of “being strangled by a wife LOL” (she already killed me several times in her head LOL)

you can add many sensor as you want (as many as webcore allows in a single piston) I believe up to 30 or smthg like that…

If seperate rooms we are talking about.I would normally create individual pistons for each room.

if you have more questions for the next instance just shoot,I’ll do my best:)


#11

Ike thank you so much. I am going to shut it down for tonight, but tomorrow I am going to test something like I attached here. I tried to set it up with variables…But I cant test all the doors because it is close to midnight and everyone is sleeping…And I will surely be killed by wife and kids if I start opening them.

Here is what I did, Ill test it out and get back to you. Again, thanks for all the help. If you have donate button or something let me know.


#12

I’ll check it out…
Thank you for the thoughtful gesture you are very nice… I am just here to help… I had struggled a lot at the beggining and this amazing community helped out a lot. Now my house is in greate shape and this is just paying it forward lets say.

if you click on SOLVED that would be great for the people who comes later with similar problem… That’s all I can ask:)))

Thank you…

Update : I looked at it… It should work. I just don’t know what will you do with the variables in this case? It’s great IF you want to add more sensors in the future. You don’t have to add them to 3 conditions one by one, you can just add them to the variable. But other than that do you have any plans with it?

Update : So sorry, I was not reading the speak part LOL
I like it…
It should be fine (never say DONE without testing in smart homes:))) I don’t know what would happen if two doors are opened at the same time or just a couple of seconds apart though. The piston will be triggered, matching devices saved, another door opened, piston re-started and saved the new matching devices…himmm never tested this… let me know… (but maybe in your case this will never happen. In my house we have 4 entrance doors and NEVER they’ll be opened the same time or even a minute apart - living style)


#13

I just realized you posted the same question in two threads, so I am moving my response to this one:


At a quick glance, it seems that the moment your door opens, piston “49pv” will pause itself… Is that intentional? I don’t see any code to resume that piston, so I assume the logic for that is elsewhere… I suspect that the UNpausing later may fire off the trigger once again.

For what it’s worth, wherever possible, I try to never pause a functioning piston. I just tweak my code accordingly.

That being said, I have seen a handful of doors that vibrate when closing, so it may be briefly changing to close-open-close all in under a second. (although your log would identify this)


#14

To summarize Ike (if I may)

In your original piston, whenever your contact sensor changes (opening or closing) the entire piston runs top to bottom. Meaning, when the door closes, it will run the final ELSE statement.

Putting each of the 3 possibilities in their own IF block (without using else) sounds best to me.
(like the “2p2sr” above)

The only small change I would make to his is:

  • Greater than 75 (which is 75.1 and up)
  • Less than 30 (which is 29.9 and under)
  • Inside the range of 30-75

Using the temps in “2p2sr” will not run any code if the temp is 30.1 - 30.9 or 74.1 - 74.9


#15

Nice…
thank you so much @WCmore
And @Philpan hear him out, lots of my pistons are written by him.

Yeah I knew something was up with that ELSE :)))) but I did not know what it was LOL

And thank you for the better version of the piston…
Since you are here let me ask you… Do sensors register .1 .2 .3s??? or they just skip from 38 to 39??? how do they work???


#16

Oh… Well it depends on the device if decimals are read. (many of them do see decimals)


#17

@ike2018 and @WCmore thank you both for all your help. This morning I woke up excited to hopefully get everthing set up and running. And I now have a very strange issue happening, and I have no idea where to start to fix it.

So when I attempt to use the Piston with the pistons…This one.


It completely locks up my Echo Speaks, and nothing speaks at all anymore. I have to go into the Echo Speaks app, and reset my Heirko Login Info.
Once I reset everything, if I pause this Piston and unpause the original one you guys got my using…This one.
Then everything continues to work just fine.

I have no clue why this could be happening. I looked over the variables code and it seems like it should work. ??


#18

When a piston doesn’t work but looks like it should, I would start testing step by step.
You can test this with a door sensors or simulated switch.

let’s simplify your current piston to test it. Maybe echo speaks has some issues with formatting of the variables?? (I don’t know because I have never used Echo speaks)

1 - by the way, please test your current one first and post your logs.
2 - Try something like this:

Device testswitches : contact one, contact two
device testresult

IF testswitches changes to open
save matching devices to testresult
then
speak (testresult) is on now

(don’t mind the syntax. this is just an example to identify the problem)


#19

Ike, which logs would I post? Logs from webcore, or Smarthings? Which is the best practice to get them?

As it turns out also, it seems it wasnt just the running of that one Piston. As I turned it off. And went out for a bit. When I came back home, nothing was working. Nothing speaking again.

I dont know what it could be.


#20

Hi Phil,
Logs from webcore…