ahh ok. shouldnt require a copy of the entire code β¦ using a conditional setting for arrived or departed should also work.
Arrival of people including multiple people at once
i will post an example later.
just to be sure - you are looking to announce arrivals and departures. arrivals with contact sensor closing and departures after 30 secs from last departure?
This piston is working great so far, apart from the and I think. Let me know if you can improve it.
Yes to arrivals /departures for single and multiple people. But log and announce arrivals (log only once but announce up to twice (just in case not in building yet)).
For departures log someone or more than one leaves and announce only if someone is still in the house and only once for both.
For me im using the motion stopping as I donβt have a door contact installed yet. But yes it would be better if i could have it so it happens 30 secs from last departure (at the moment its the same as arrive).
All this happens on my current piston apart from the departure after 30 seconds bit.
Edit: would this do that, ($now - lastNow) is equal to 30000?
well if its working for you i dont need to write up another example.
sorry thought you had some issues with the double copy portions of the code and that needed fixing or something.
Yeah still having a issue with the text bit but the main bit I think it running well. Still need to run it abit more to be sure. I would also like to trigger the leave bit 30s after the last departure, rather than the contact, could you show me how to do that please?
How to send random text messages from a list
Help with Arrival Piston (Sonos Welcome Home)
Just testing this out and seems to be working well, thanks for your help!
But I canβt understand the santex for the announce in order to change it to my liking if i wanted to so something like this for arive how would i do it?
Welcome home ($name or $name and $name), ($name or $name and $name) (is or are) in the house! woop woop, woop woop!
from this:
(whoI == 1 ? βWelcome home β : ββ) + (i > 0 ? left(who[whoI], i) + β and β + right(who[whoI], length(who[whoI]) - i - 2) : who[whoI]) + (whoI == 2 ? β has left the building!β : ββ)
Was thinking once i understood it would it be possible if it was set to on events from current place. you could announce when the person left and when they arrived at a new place?
try this:
(whoI == 1 ? βWelcome home β : ββ) + (i > 0 ? left(who[whoI], i) + β and β + right(who[whoI], length(who[whoI]) - i - 2) + β areβ : who[whoI] + β is ') + (whoI == 2 ? β has left the building!β : β in the house! woop woop, woop woop!β)
Donβt know how you do it! Awesome thank you! but it now makes even less sense to me
mostly practice. you are welcome.
there are 3 parts to this.
this is what to say before the name(s):
(whoI == 1 ? βWelcome home β : ββ)
this removes the last ',' if there and replaces it with 'and' in the names. also adds 'is' or 'are' after the name(s):
(i > 0 ? left(who[whoI], i) + β and β + right(who[whoI], length(who[whoI]) - i - 2) + β areβ : who[whoI] + β is ')
this is what to say after the name(s):
(whoI == 2 ? β has left the building!β : β in the house! woop woop, woop woop!β)
whoI = 1 for who came home
whoI = 2 for who left home
Yeah I think iβm starting to read it better i missed the closed brackets and didnβt read the equation correctly.
where do we put the names if we want to use them more than once?
create another variable called names so:
names = (i > 0 ? left(who[whoI], i) + β and β + right(who[whoI], length(who[whoI]) - i - 2) + β areβ : who[whoI] + β is ')
then:
(whoI == 1 ? βWelcome home β : ββ) + names + (whoI == 2 ? β has left the building!β : β in the house! woop woop, woop woop!β)
also lets you use names as many times as you want in the message.
ahh β¦ no you dont need to because the names variable will get set when its time to speak it.
great So almost there so with the piston above i just departed and got this on the announce.
Goodbye Emma is Emma is has left the building!