Could someone help me with the modification of the automation below. I would like to extend the automation to send me a text if a certain sensor called ‘sensor.weston_ett_home’ is greater than 45.
I think this is supposed to be done with using choose but I really don’t know how. Everything that is occuring below in the current automation, I would like to occur in both sides of the choose.
Thank you all so much!!
- id: weston_leaves_work
alias: weston Leaves Work Notification
initial_state: true
trigger:
- platform: zone
event: leave
zone: zone.tdot
entity_id: person.weston
condition:
- condition: state
entity_id: person.weston
state: "tdot"
# optional: trigger only if state was this for last X time.
for:
hours: 3
minutes: 0
seconds: 0
- condition: time
after: "15:00:00"
before: "18:00:00"
action:
# - service: input_boolean.turn_on
# entity_id: input_boolean.weston_travel_monitor
- service: script.status_annc
data_template:
who: "kitchen"
call_interruption: 1
call_weston_location: 1
- service: script.text_notify
data:
who: "clarice"
message: "Weston has left work."
Since you want the rest of the sequence to always occur, you really don’t need to use a Choose action for what you have described. It can be done by adding a Condition action and your text action at the end of current action sequence. If the condition is false, any actions after it will not be executed.
There is at least one way to accomplish something like this. There are probably a few other ways, but they are all going to require some sort of additional sensor or helper.
Maybe I’ve misunderstood the automation but it appears to trigger the moment a person has left a zone and then its condition checks if the person hasn’t been in that zone for at least 3 hours.
I don’t see how the condition can ever be fulfilled. It doesn’t wait until the person is gone for 3 hours it checks if the person has already been gone for 3 hours (and they haven’t because they just left).
@Didgeridrew@123 Oh, I’m terrible at this. What I am trying to get to happen is if I am at work for at least three hours and then I leave… Actions happen.
The lowest additional effort method would be to use an Input datetime helper, an added trigger, and a Choose action… you’ll just need to set up an input datetime helper (select the kind with both date and time).
You may need to move or alter the time condition, depending on your schedule… if you normally leave work and then return after 15:00, you can leave it as is. Otherwise, move the time condition to just below default:.
Ahh, I see. Essentially an input of the time at a zone. I see what you are getting at though. Your first solution overall seems like less of an annoying headache through the life of the automation. Thank you for teaching me some things @Didgeridrew I have no doubt these ideas will come in handy in the shortly as I adjust my code for this one and in the future!! Thank you so much again!!