Could you all help me with the subject and the automation below?
Essentially I am getting text messages that an action has occurred when it didn’t actually happen. I think I have determined that this was due to a hardware failure on a zwave garage door opener.
Is there anyway to guard against this in the automation. Can someone possibly show me an example based on what I have below?
alias: >-
(ACTION- AUTOMATIC- SECURITY- NOTIFICATION) Garage Doors Close when Away and
at Night
description: ""
trigger:
- platform: sun
event: sunset
offset: "-00:00:00"
- platform: state
entity_id:
- alarm_control_panel.alarmo
to: armed_home
enabled: false
- platform: state
entity_id:
- alarm_control_panel.alarmo
to: armed_away
enabled: false
- platform: state
entity_id:
- alarm_control_panel.alarmo
to: armed_night
condition:
- condition: template
value_template: "{{ garagedoorsopen |count > 0 }}"
- condition: state
entity_id: input_boolean.guest_mode
state: "off"
action:
- data: {}
target:
entity_id: "{{ garagedoorsopen }}"
action: cover.close_cover
- data:
who: parents
title: GARAGE DOOR WARNING!
message: >-
The following door{{ iif(garagedoorsopen | count > 1, 's were', ' was')
}} closed: {{ garagedoorsopenname |join('\n') }}
data: null
group: garage_doors
tag: null
action: script.text_notify
mode: single
variables:
garagedoorsopen: |
{{ states.cover
|selectattr('state', 'eq', 'open')
|selectattr('attributes.device_class', 'eq', 'garage')
|map(attribute='entity_id')
|list }}
garagedoorsopenname: |
{{ expand([garagedoorsopen])
|map(attribute='name')
|list }}
Can you see in the trace what’s working and what isn’t?
To tell you the truth, I would look at this, draw a block diagram flow chart, and just rebuild it using the UI editor in home assistant. Then you will understand what is happening and be able to support it when it breaks in the future.
If someone here tries to re-write it for you, you will won’t understand it either. You’ve been with HA a few years now, so it shouldn’t be too scary for you. If someone want to do that, it’s fine with me, but it’s not a lot of fun writing IOT code without the hardware.
Another thing you can do is search the blueprint exchange category here, I bet someone does something the same or similar. Use that or take control of something similar that works and adapt it.
The only way I would suggest to properly guard against this happening is to install door sensors on those garage doors.
Add a small delay at the bottom of your automation, then check the state of the sensors - if they’re still reporting as open after the time it should take for the doors to close, trigger a notification to go check it out.
That’s the thing is that in the trace, it shows no issues.
It’s almost as if, the systems thought is “i sent the message to close the garage door, I’m done here”, the garage door actually never closed though and the second action in the automation is to send the text message that it closed.
Is this intended behavior in your opinion?
Current state: I excluded the offending zwave door opener from home assistant and plan on reincluding later today when I have time.
I can rewrite the automation in much simpler terms, removing all of the variables etc but I am really wandering if this still would’ve occurred if the automation were in those simple terms. (This automation has worked for a long time)
I’m really just wandering if a non responsive piece of hardware can be protected against. I believe that is the culprit in this situation—> but the scary part to me is that nothing errored in the automation based on the trace/ logs.—> I think this is why I’m trying to figure out if home assistant is happy with “I delivered the message” vs “this action actually happened”
On the last sentence above, just to clarify, I have no technical understanding of how all of this works. Just assuming to the best of my abilities
Thank you for this idea. I think that is a good simple go at things.
I’ve never really liked this zwave gocontrol module but if I can get it reconnected, I will go this route I believe.
It was acting very odd this morning when I was trying to get it reincluded and had no luck. So worst case, maybe it is time for a new garage door solution.