One of my automations that opens the garage when group “family” state changes to “home” (at least one group member comes home) starts by itself when I restart the service. I have added the check for HASS start and its strange why it started so late…
Here is the sequence of events:
Open garage when family member comes home and garage door is closed has been triggered by state of group.family
11:32:38 PM - 18 minutes ago - Show trace
Home Assistant has started up turned on by Hass Startup Notification
11:29:03 PM - 22 minutes ago
Uptime seconds changed to 50
11:29:00 PM - 22 minutes ago
Garage Door turned on by Car in Garage
11:28:36 PM - 22 minutes ago
Car in Garage was detected at home
11:28:36 PM - 22 minutes ago
garage_door_lock was locked
11:28:31 PM - 22 minutes ago
Hass Startup Notification has been triggered by Home Assistant starting
11:28:31 PM - 22 minutes ago - Show trace
Garage Door Status changed to Closed
11:28:31 PM - 22 minutes ago
Family changed to Home
11:28:31 PM - 22 minutes ago
We were all at home. Group family status before restart was Home. So looking at the time after restart, Family changed the status to “Home”, but that was before this event, that is a condition of the automation, that happened 30 seconds later:
Home Assistant has started up turned on by Hass Startup Notification
11:29:03 PM - 22 minutes ago
And the automation was triggered at 11:32:38 PM, which is like 3.5 mins later. I am lost as to why it happened and what to do to stop it.
Tace has this:
Triggered by the state of group.family at June 4, 2021, 11:32:38 PM
Test state condition
condition 0 entity_id 0
Test state condition
condition 1 entity_id 0
Call service cover.open_cover on entities cover.mygarage
1 second later
Garage Door Status (sensor.garage_status) changed to Opening
Call service notify.family_devices
Finished at June 4, 2021, 11:32:39 PM (runtime: 1.12 seconds)
And… Looking at the trace file again, there is another event just seconds later, but this time it did not fire up, probably because it was already open:
Triggered by the state of group.family at June 4, 2021, 11:32:52 PM
Test state condition
condition 0 entity_id 0
Stopped because a condition failed at June 4, 2021, 11:32:52 PM (runtime: 0.00 seconds)
This is my automation:
alias: Open garage when family member comes home and garage door is closed
description: ''
trigger:
- platform: state
entity_id: group.family
to: home
condition:
- condition: state
entity_id: cover.mygarage
state: closed
attribute: door_state
- condition: state
entity_id: input_boolean.homeassistant_booted
state: 'on'
action:
- service: cover.open_cover
target:
entity_id: cover.mygarage
- service: notify.family_devices
data:
message: >-
Family member {{ trigger.to_state.attributes.friendly_name }} came home.
Opening garage
mode: single