I need some assistance with troubleshooting some automations.
every now and than, i walk by a motion sensor, waiting for the light to light-up, just to be disappointed.
Than, while mumbling various curse words at the motion sensor as i walk over to check what went wrong, i see that the motion sensor worked fine, but for mysterious reason the automation went with “no action was executed”.
it looks like this:
this is just a simple automation to turn on a lite, with different brightens values depending on “time” (of day).
can anyone give some pointers as to where would be the best place to look for a solution to figure out why this (or any other misbehaving automation) happens?
ill be happy to provide other info as needed. but what I’m looking for is some tips on how to troubleshoot in general, and not specific to this automation.
cheers
If you want our help, it is much easier for us if you share the the YAML configuration of the automation.
From the image of the trace’s flow diagram you posted it looks like your trigger fired, but none of the Choose action’s condition sets passed, so none of the action sequences were executed.
understood, i am trying to figure out where to look for a reason - which condition was not met.
in this specific case the light turned on 15 s later, as the motion sensor fired up again and the automation re-triggered.
thanks for the link, i will check it out. i just love this community so much that my “GO TO” is usually here…
here is the yaml
If you click on the conditions for each Option of the choose (the empty square symbol), the “Step Details” should populate with information about the conditions that passed and/or failed. However, it may not show all the conditions for a given Option because the checks stop after the first failed condition.
That part of my problem, i guess.
with my logic, and the way i’m (clearly poorly) reading the info - it looks like “it should’ve worked”, and i cant get a “clear enough” reason as to way it didnt work as i thought…
ill try figure things out with the pointers given here, and will post again next time i’ll get baffled.
stay tunned…
and thanks for the help and quick replies so far.
appreciated as always
cheers
The flow diagram suggests that none of your condition blocks was met, which caused the flow to go straight to the end with no action taken.
A couple of comments:
it’s much easier to read and debug entity-based triggers and actions rather than device-based ones. So, for example:
triggers:
- trigger: state
entity_id: binary_sensor.YOUR_MOTION_SENSOR_ID
to: 'on'
It’s also not a great idea to build long execution times into automations. As each of your sequences does the same thing, I’d be inclined to move the turning-off logic to a separate automation:
triggers:
- trigger: state
entity_id: binary_sensor.YOUR_ENTITY_ID
to: 'off'
for:
minutes: 5
- trigger: state
entity_id: light.entrance
to: 'on'
for:
hours: 1
actions:
- action: light.turn_off
target:
entity_id: light.entrance
gr8, i was just wondering about this issue myself. though the devices are Easley identified via UI mode, its unnecessary harder to understand which is which via yaml.
i will return to using entities when re-writing the automations I’m dealing with.
also understand your logic about the “off” sequence, as i use the “off” as a separated trigger in most of my automations.
thing is, in this case, i didn’t want the automation to trigger “off”, if i manually turned on the light, so it made sense to have it turned off, only if the automation turned it on itself.
you are correct of course, as i found the hard way misbehaving “too long sequences” automations, and needed to rewrite’m.