Announcement Piston help


#1

1) Give a description of the problem
trying to get this piston to work correctly really dont understand it when my wife and i get close to the house (different times) lights dont come on and no announcements made. if my son gets close to the house the piston works announcements made and lights come on even at 3 am :frowning: . if my daughter gets close to the house she just has the lights no announcements Very strange

2) What is the expected behaviour?
i need the speaker not to announce after a certain time say between 22:00 to 06:00 but keep the lights on if we arrive anytime through the night

3) What is happening/not happening?
speaker announces through the night

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Just a quick look from my phone…line 98 will need a more specific time interval to keep announcements from happening at night. You might need another IF and time restriction that is different for the lights.


#3

thank you this work is not mine might have to bin it and try and do something much more simpler just looked a nice piston having alexa welcoming the specific person coming through the door


#4

To be honest that piston is way too complicated for me to understand. (I’m not a coder LOL)

But I can draft you something simple:

You need to use presense senors as a trigger and then “time restrictions” as a condition. But I must say, presense sensors are known to be NOT RELIABLE. Plus sometimes even when you are home they JUMP on the map and your system sees that as “Oh someone just arrived”

This one is a very simple piston, but at least this is a start.
Line 20 is to stop the piston executing from gps jumps.


#5

im far from being a coder myself lol now with putting times in where pantheon said i hope it works ill have a go with yours tho thanks

^^^^^ Update of first one ^^^^^^


#6

@Gazza, no offense, but if you are not a coder, then that large piston may be a handful for you. You will find excellent help here. So if you are willing, we will all jump in with you to get what you desire. I’ll take a closer look at that piston when I get to my computer.


#7

I wanted to say the same thing, but you said it really well…


#8

@Gazza
Before I dig into this, I want to be absolutely clear. My experience with presence sensors has been much less than comforting. My own tests demonstrated variability by several minutes with each test. Your results may vary. I DO NOT rely on presence sensors for time-critical events like this large piston. My first suggestion would be to test your presence sensors with a very simple piston (many available in this forum). Check your results before we get into this.


#9

ok i would like to have a go at this piston if you could help me :slight_smile:) but if you think its to big and out of my league i fully understand
i run it last night and had a bit of a result this time around the presence sensors worked for some strange reason
When i did the first run i use my door sensor when entering and i thought that was the problem so i thought i might use my ring door bell motion part instead so i think that part is sorted (as long as the presence sensors are ok lol)
now throughout the day the lights didnt come on (which is fine) alexa still spoke which is all good.(made my little girl laugh) now i work into the night and when i came home the lights came on (well they were on when i arrived) walked in so the motion picked me up then got in the house not long when i was in alexa spoke which wasnt ideal at 3am lol

so all in all i think i need to get alexa to stop talking at night between 22.00 and 06.00 i did add that IF time in like you suggested but i might have put it in wrong its on line 86

thank you


#10

I am more than happy to help. But this piston relies on 4 different presence sensors.

  1. Did you test the accuracy/reliability of your presence sensors? Even if they are off by just a little bit, you could already be at home and in the shower before your lights turn on or Alexa speaks.
  2. If your are comfortable with how your presence sensors are working, then you might be able to reach out to the original programmer of this piston and ask for assistance in the light timing and Alexa notifications.

#11

they all run on life360 and since i made the radius slightly bigger it has worked well once either one of us arrive about 20 - 30 sec alexa does speak (just now as i right this my son has just left and he left the circle and alexa has just said goodbye) all i need is Alexa not to speak after a certain time

ive replied to the original programmer but as of yet no reply


#12

this is the link Arrival of people including multiple people at once where i found the original piston and the programmer that made it


#13

Do you still want Alexa to be silent between 22:00 and 06:00?
Also, what are you time requirements for the lights? I would change this a little…

Gazza%20Lights


#14

yes would need the time between 22.00 to 06.00 lights not important as long as they turn off

ive also read the post about the piston on the link and i have found an updated version that gives times line 112 for speaker i think ill send a snap shot i just dont understand the GET part


#15

I have not tested this piston or the changes that I am making so we may need to make more modifications as we go. But let’s start here…

  1. Not sure what is happening with the GET as it is empty. For now, I would delete the entire ONLY WHEN statement that contains the GET.
  2. As for silencing Alexa, I would put this entire section into a new IF
    like this…
    IF Time is NOT between 22:00 and 06:00
    Then

Using the NOT condition is favored when spanning the midnight hour. (Thanks @WCmore). You could use Time is between 6:00 and 22:00.


#16

im going to test this updated piston as i have to pop out for 1hr ive adjusted the times for the speaker just to test it should i just leave the GET request as i no idea what this is does


#17

It looks like the original user was making a GET statement to her Sonos to speak the text. If your “Speaker” is an Alexa, then you will not need the GET.


#18

ok ill remove this before i go out ill let you know what happens

3/5/2020, 2:36:32 PM +231ms
+0ms ╔Received event [My home].test = 1583418992230 with a delay of 1ms
+88ms ║RunTime Analysis CS > 21ms > PS > 6ms > PE > 60ms > CE
+92ms ║Runtime (58702 bytes) successfully initialized in 6ms (v0.3.110.20191009) (90ms)
+93ms ║╔Execution stage started
+104ms ║║Calculating (datetime) 1583418992331 - (datetime) 1583418992316 >> (datetime) 15
+109ms ║║Comparison (datetime) 15 is_greater_than (integer) 300000 = false (1ms)
+111ms ║║Condition #27 evaluated false (12ms)
+112ms ║║Condition group #24 evaluated false (state did not change) (14ms)
+126ms ║║Condition #20 evaluated false (8ms)
+134ms ║║Condition #56 evaluated false (7ms)
+136ms ║║Condition group #55 evaluated false (state did not change) (17ms)
+137ms ║║Condition group #11 evaluated false (state did not change) (20ms)
+144ms ║║Comparison (time) 52592371 happens_daily_at (datetime) 1583418992316 = false (0ms)
+145ms ║║Condition #49 evaluated false (5ms)
+147ms ║║Cancelling statement #49’s schedules…
+151ms ║║Requesting time schedule wake up at Thu, Mar 5 2020 @ 2:37:02 PM GMT
+154ms ║║Condition group #38 evaluated false (state did not change) (13ms)
+161ms ║║Comparison (integer) 0 is_greater_than (integer) 0 = false (1ms)
+162ms ║║Condition #65 evaluated false (5ms)
+164ms ║║Condition group #61 evaluated false (state did not change) (6ms)
+189ms ║╚Execution stage complete. (95ms)
+190ms ║Setting up scheduled job for Thu, Mar 5 2020 @ 2:37:02 PM GMT (in 29.895s)
+202ms ╚Event processed successfully (202ms)


#19

From the original user…


#20

no sound from alexa which is good

+1ms ╔Received event [Ring - Front Door].motion = inactive with a delay of 62ms
+77ms ║RunTime Analysis CS > 16ms > PS > 4ms > PE > 57ms > CE
+80ms ║Runtime (58757 bytes) successfully initialized in 4ms (v0.3.110.20191009) (78ms)
+81ms ║╔Execution stage started
+91ms ║║Calculating (datetime) 1583421852238 - (datetime) 1583421651453 >> (datetime) 200785
+95ms ║║Comparison (datetime) 200785 is_greater_than (integer) 300000 = false (1ms)
+97ms ║║Condition #27 evaluated false (11ms)
+98ms ║║Condition group #24 evaluated false (state did not change) (12ms)
+108ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+109ms ║║Cancelling condition #20’s schedules…
+110ms ║║Condition #20 evaluated false (7ms)
+116ms ║║Comparison (enum) inactive changes_to (string) inactive = true (1ms)
+117ms ║║Cancelling condition #56’s schedules…
+118ms ║║Condition #56 evaluated true (7ms)
+120ms ║║Condition group #55 evaluated true (state did not change) (17ms)
+126ms ║║Comparison (boolean) true is (boolean) false = false (2ms)
+127ms ║║Cancelling condition #29’s schedules…
+128ms ║║Condition #29 evaluated false (8ms)
+130ms ║║Cancelling condition #11’s schedules…
+130ms ║║Condition group #11 evaluated false (state changed) (28ms)
+136ms ║║Comparison (time) 55452284 happens_daily_at (datetime) 1583421651453 = false (0ms)
+138ms ║║Condition #49 evaluated false (5ms)
+139ms ║║Cancelling statement #49’s schedules…
+142ms ║║Requesting time schedule wake up at Fri, Mar 6 2020 @ 3:21:21 PM GMT
+145ms ║║Condition group #38 evaluated false (state did not change) (12ms)
+151ms ║║Comparison (integer) 0 is_greater_than (integer) 0 = false (1ms)
+153ms ║║Cancelling condition #65’s schedules…
+154ms ║║Condition #65 evaluated false (6ms)
+155ms ║║Cancelling condition #61’s schedules…
+156ms ║║Condition group #61 evaluated false (state changed) (9ms)
+159ms ║╚Execution stage complete. (78ms)
+160ms ║Setting up scheduled job for Fri, Mar 6 2020 @ 3:21:21 PM GMT (in 86229.142s)
+171ms ╚Event processed successfully (171ms)

my wife comes in soon ill change the time settings now so alexa should talk