#What I am trying t o accomplish is
1 messages ยท Page 1 of 1 (latest)
Ok, that's pretty easy. So, whenever one of you arrives into the zone, open the door? Do you want the inverse of that too?
no- I don't feel confident in closing the door - too many variables there.. I just want it to open...
Ok. What are the conditions for the door opening? Anything specific you can think of?
cell phone enters the home zone.. thats what I am using as a trigger and it seemed to work fine..
that is, till my wife and I were in the same car and returfned home together and both automations ran- there by stopping the door at 1/3 up
Ahhhhh gotcha. Ok, that's what I was looking for. So, really what you need is 3 triggers. One if you arrive home, one for your wife and one if you're together.
This can be one automation, tbh.
I am also considering adding my teen daughter into the mix..
Still easy.
I am contemplating using 3x "When" triggers with event IDs...
then usinfg a choose to go to a set of actions depending on who is coming home..? hmmm.. still don't know how it would act if two of the "When" evals returns as true..
So, the easiest way to accomplish this is exactly that. Three entity state triggers (one for each of you) and the mode set to single.
That's where the single mode comes into play. It only allows one instance of the automation to run.
not sure what it means though..
But, I'd add a delay into the automation at the end to allow ffor the door to be completely open before the automation stops.
I mostly use the gui editor as I am trash when it comes to yaml and indention.. ๐
so "single" means the automation takes off when one of any of the triggers is true, then wont restart or something?
So, there are 4 modes for automations/scripts:
1, single = one instance only at a time
2. restart = if the automation is already running, stop it and start again
3. parallel (max #) = allow multiple instances of the automation to run at the same time
4. queued (max #) = Run the automation, but queue up multiple instances if the triggers fire again.
> Mode will allow you to change the mode in the UI. ๐
Do you know roughly how long it takes for the garage door to open?
I guess like 6 seconds maybe 8?
description: ""
mode: single
trigger:
- platform: state
entity_id:
- person.bill
from: not_home
to: home
- platform: state
entity_id:
- person.bill
from: not_home
to: home
- platform: state
entity_id:
- person.bill
from: not_home
to: home
condition: []
action:
- service: cover.open_cover
target:
entity_id: cover.dining_room_curtains
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
I'm also just starting on automations for signficant things... still trying to figoure out if they shoud be device-centric or person-centric or purpose-centric or..
NEVER device centric. NEVER.
so like, if I had a garage door automation where it looked for various things to change its state, that would be bad..?
Ahhhh, no. That would be fine.
so device centric means more like "lightbulb #1"
Sorry... thought you meant device triggers and actions. Avoid those.
Yup. I got ya now.
So, the way that I have my automations are basically in terms of areas/devices/events, if that makes sense.
this is all just musing about things at the moment.. For example, I made one automation for each zone.. like Wife Wirk Me Work Wife Home Me Home etc
so if I made it person-centric, I could have triggers for Wife Home Wife Work Wife Store etc
Yup and that's perfect. You could combine them into a bigger automation, but there are pros and cons for that.
Yeah, you could do that too.
Either way works and it really boils down to how your brain works. So, for me, I think of my automations in terms of areas first (Attic, bathroom, hallway, living room, etc). Then, I do my automations by what I need to happen in that area.
so.. I suppose I could make a single automation for "Home Zone" and then have it watch for each person exit/entry and then do stuff based on that. hmm though, I am trying to think if that risks another unintended consequence.. like I am driving oout as my daughter returns from a walk so we have an enter and an exit at the same time...
if its in single and timed to wait, it might not see the trigger of daughter retuns from walk
That's where the mode and holding state comes into play.
Actually, if you are leaving, unless you have triggers setup on that, it would be fine. The automation above would still fire.
I do have leaving triggers to send txt messages to wifes phone
eg "Me has left home"
or "wife has left work"
Eh, those would be fine. But, you can also do things based upon how many people are home as well. zone.home returns an int of how many people are in the zone.
"wife has left work" goes to my daughters cell so she knows she has about 30 mins to do everything my wife asker her to do that day ๐๐๐คฃ
lmao that's actually pretty awesome.
Yeah, all of those would stiil fire and I would keep them in separate automations.
so all the "left <zone>" in one automation and all the "entered <zone>" in another..?
Yup
That way you have concurrently running automations.
So, you could do separate automations for you leaving/arriving, your wife leaving/arriving and your daughter leaving/arriving. So, 6 automations total.
Plus, don't be shied away from having a lot of automations. HA can handle it.
I have 99 (right now) for my tiny house.
You mean in a parallel block or multiple automations all firing at the same time?
- conditions:
- condition: trigger
id:
- home-yes
- condition: sun
after: sunrise
before: sunset
sequence:
- parallel:
- device_id: b55035b38e57772127407ff4afafb367
domain: cover
entity_id: 300e86600bda34f495c8c7220f4f0af3
type: open
- service: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.alarm_speakers
message: Vern has entered home zone. Opening garage door.
target:
entity_id: tts.home_assistant_cloud
- service: notify.mobile_app_kyms_iphone14
data: {}```
Get those device ids out of there and we'll talk ๐ lol
yeah.. those are created by the gui.. ๐ฆ
Ok, so parallel can be tricky. You have no control over what order they fire in.
I was gunna post the screen shot from the gui but this stupid discord doesn't allow gfx pastes ๐
So, in that parallel block, the tts.speak can fire after the notification.
Yeah, I know... lol it bit me too.
changes ARE coming 
I prefer the yaml code anyhow ๐
I am interested in the alerts happening asap... I put them in parallel since it seemed they wouldnt conflict with one another since they all went different places...
Right and that's fine.
Just be aware that in parallel blocks, some things may happen before other things.
wait., what? that makes no sense
"these parallel things happen in this sequence" seems like ..uhmm
For instance, I have a message handler script that gets a generated message from Google AI. The first thing I have to do is create variables, then call google, then I can process the rest. So, a prallel block wont' work for me.
Yup. It doesn't work that way in HA.
Some of the caveats of running actions in parallel:
There is no order guarantee. The actions will be started in parallel, but there is no guarantee that they will be completed in the same order.
If one action fails or errors, the other actions will keep running until they too have finished or errored.
Variables created/modified in one parallelized action are not available in another parallelized action. Each step in a parallelized has its own scope.
For the most part, every action shold happen as close to the trigger as is possible.. I want the text message to come right away.. I want the tts to announce the person, I want the door to open all as soon as the trigger is detected...
And usually that will happen. But it's not guaranteed.
Each action gets thrown off to a separate thread (for all intents and purposes). There's no guarantee they'll complete in order.
ah.. so "parallel" means to spawn a task/thread to handle each - instead of a thread spawned then wait till its done, then spawn the next thread..?
Right... async versus sync.
So, this is my message handler. I need the actions to flow in order, so I can't use parallel here: https://imgur.com/a/QO9J7eA
ok.. so is the thread spawn in the order the events are listed unde the "parallel" block..?
Yup, basically the backend loops over the actions and throws them into threads.
But, because of the async nature of it, some tasks will complete before others and wiill throw the actions out of order. In your use case, that's perfectly fine. You don't care about order. But in a script like mine, order matters.
in an automation, can I have two (or more) triggers have the same trigger ID e.g.
"Me enters home zone" event id "home-yes"
"Wife enters home zone" event id "home-yes"
Sure.
That way, the same actions happen regardless of which one of you triggered it.
hmm.. I'm already seeing a problem.. I need separate ids so I can do the right text messages like "Wife arriving home" instead of "someone arriving home"
Actually... no. But if you strictly want to use the UI, yes. You can determine exactly what trigger fired and use the data there to build the message out. BUT, you'd need to YAML it.
I get super frustrated trying to use the yaml w/o the gui.. I make some small mistake and the yaml syntax is blown up and I'm dead and don't kmnow enough to fix it. ๐ฆ I endup more successful if I stay in the gui...
You can still use the GUI, but you have to switch the action to YAML mode (
> Edit in YAML). You can switch the entire editor or the individual blocks themselves.
BUT... while you're learning, I'd say just stick with the GUI and go with separate trigger IDs.
Then use a choose block to determine which one of you actually triggered it.
I have to struggle with yaml for all my esphome stuff so I guess I'll eventually give up the "training wheels" of the gui.. ยฏ_(ใ)_/ยฏ
KISS (until you get better at it). lol
tbf, I still do a lot of stuff in the GUI and only switch to YAML if I have to. I can do everything in YAML, but sometimes it's just easier to do it in the UI.
good to know...
Plus, I have to be able to answer questions about both... sooooo, yeah ๐
in the esphome discord, I posted my most recent builds.. I "upcycled" some old tech gear including an old 1970's desk phone speaker and a pair of 1980's radio shack mini intercoms.. ๐
I put them in the "show off" section ๐
I remember the intercoms! I helped you with that automation too ๐
ah- yeah! ๐
I put the photos of the build up there now.. plus took more photos of the bell speaker phone one
ok, I'm gunna see if I can muddle my way through re-architecting the garage door automations.. lets see if I am back here sobbing in an hour or so ๐
I'll check them out! And yeah, feel free to pop back (and ping me if you want). Also, take a look at what I sent you earlier. Should be enough to get you started.
I don't think I'll have a worse day than the folks over at CrowdStrike tho ๐ค
Screw CS. I'm happy to see them burn. lol
there are some really hilarious memes floating..
You should check out #the-water-cooler ... we were having much fun at their expense.