Why is "Choose:No action taken" even an option here?

Sometimes, mostly first thing in the morning, these motion sensor lights automations just do nothing when motion is sensed. I have to leave the dark room for 90 seconds while the sensor clears then return and then the lights go on. As far as I can see there should not even be an option for “do nothing”.

What am I missing?

Thanks in advance.


Automation starts and it is supposed to finish or complete.

If a and b, do this
If c and d, do that
Otherwise, move to next step or complete the automation.

Looks like normal to me.

If you want to eliminate do nothing, you should put the default needed actions under Default actions section of choose

It’s not meeting the choose conditions for any of the choices.

e.g the motion sensor was on and the lux was not in the numeric state range specified.

Thanks!

I’m not sure I understand exactly what you mean but I’ll do some research and see where I end up.

Thanks tom.

I can’t seem to figure out which of those conditions it does not meet. The room is empty and dark. So it should just register movement and turn the lights on.

Is there a better way for me to be doing this? Besides using a timer instead of the “for” condition?

Try it without capital letters or spaces in your trigger ids.

The answer to that will be in the automation’s trace.

By “trace” I don’t mean the “Trace Timeline” screenshot you posted above. Review “Step Details” or click “Download trace”, in the overflow menu, and post it here where we can examine it.

I’ll try that thanks. Do capital letters cause some confusion?

Looking that up now…thanks so much!

Tried with no caps in my ID titles but made no difference. I did not try without spaces in the titles so I’ll do that and see what happens.

Still happens every morning. I have to walk into a dark room, walk out, wait 90 seconds, then walk back in and it works fine the rest of the day.

Here is the trace…

Again, thanks for the time taken checking this out.

{
“trace”: {
“last_step”: “action/0/choose/1/conditions/0”,
“run_id”: “857c0f1d91c9366a8b169b9de0649ea1”,
“state”: “stopped”,
“script_execution”: “finished”,
“timestamp”: {
“start”: “2022-12-06T16:21:22.797429+00:00”,
“finish”: “2022-12-06T16:21:22.800997+00:00”
},
“domain”: “automation”,
“item_id”: “1667330095647”,
“trigger”: “state of binary_sensor.studio_motion_sensor_1_occupancy”,
“trace”: {
“trigger/0”: [
{
“path”: “trigger/0”,
“timestamp”: “2022-12-06T16:21:22.797519+00:00”,
“changed_variables”: {
“this”: {
“entity_id”: “automation.studio_lights_motion_with_id_s”,
“state”: “on”,
“attributes”: {
“last_triggered”: “2022-12-06T16:18:23.475803+00:00”,
“mode”: “single”,
“current”: 0,
“id”: “1667330095647”,
“friendly_name”: “Studio Lights Motion with ID’s”
},
“last_changed”: “2022-12-06T00:25:46.847139+00:00”,
“last_updated”: “2022-12-06T16:18:23.520977+00:00”,
“context”: {
“id”: “01GKM3PBKKTVEK7TF2F9DXG7FK”,
“parent_id”: “01GKM3PBKKZP5XGD7AQTJST92A”,
“user_id”: null
}
},
“trigger”: {
“id”: “Studio Motion Sensor On”,
“idx”: “0”,
“alias”: null,
“platform”: “state”,
“entity_id”: “binary_sensor.studio_motion_sensor_1_occupancy”,
“from_state”: {
“entity_id”: “binary_sensor.studio_motion_sensor_1_occupancy”,
“state”: “off”,
“attributes”: {
“device_class”: “motion”,
“friendly_name”: “Studio Motion Sensor 1 occupancy”
},
“last_changed”: “2022-12-06T16:19:53.476614+00:00”,
“last_updated”: “2022-12-06T16:19:53.476614+00:00”,
“context”: {
“id”: “01GKM3S3G47T98GNT92FB12NQJ”,
“parent_id”: null,
“user_id”: null
}
},
“to_state”: {
“entity_id”: “binary_sensor.studio_motion_sensor_1_occupancy”,
“state”: “on”,
“attributes”: {
“device_class”: “motion”,
“friendly_name”: “Studio Motion Sensor 1 occupancy”
},
“last_changed”: “2022-12-06T16:21:22.796464+00:00”,
“last_updated”: “2022-12-06T16:21:22.796464+00:00”,
“context”: {
“id”: “01GKM3VTQCSYWD43FATMBMVSH0”,
“parent_id”: null,
“user_id”: null
}
},
“for”: null,
“attribute”: null,
“description”: “state of binary_sensor.studio_motion_sensor_1_occupancy”
}
}
}
],
“action/0”: [
{
“path”: “action/0”,
“timestamp”: “2022-12-06T16:21:22.799437+00:00”,
“changed_variables”: {
“context”: {
“id”: “01GKM3VTQDZK554YG1Q3ZRWKWE”,
“parent_id”: “01GKM3VTQCSYWD43FATMBMVSH0”,
“user_id”: null
}
}
}
],
“action/0/choose/0”: [
{
“path”: “action/0/choose/0”,
“timestamp”: “2022-12-06T16:21:22.799511+00:00”,
“result”: {
“result”: false
}
}
],
“action/0/choose/0/conditions/0”: [
{
“path”: “action/0/choose/0/conditions/0”,
“timestamp”: “2022-12-06T16:21:22.799537+00:00”,
“result”: {
“result”: true
}
}
],
“action/0/choose/0/conditions/1”: [
{
“path”: “action/0/choose/0/conditions/1”,
“timestamp”: “2022-12-06T16:21:22.799564+00:00”,
“result”: {
“result”: false
}
}
],
“action/0/choose/0/conditions/1/entity_id/0”: [
{
“path”: “action/0/choose/0/conditions/1/entity_id/0”,
“timestamp”: “2022-12-06T16:21:22.799579+00:00”,
“result”: {
“result”: false,
“state”: 87,
“wanted_state_below”: 80
}
}
],
“action/0/choose/1”: [
{
“path”: “action/0/choose/1”,
“timestamp”: “2022-12-06T16:21:22.799624+00:00”,
“result”: {
“result”: false
}
}
],
“action/0/choose/1/conditions/0”: [
{
“path”: “action/0/choose/1/conditions/0”,
“timestamp”: “2022-12-06T16:21:22.799637+00:00”,
“result”: {
“result”: false
}
}
]
},
“config”: {
“id”: “1667330095647”,
“alias”: “Studio Lights Motion with ID’s”,
“description”: “”,
“trigger”: [
{
“platform”: “state”,
“entity_id”: [
“binary_sensor.studio_motion_sensor_1_occupancy”
],
“id”: “Studio Motion Sensor On”,
“from”: “off”,
“to”: “on”
},
{
“platform”: “state”,
“entity_id”: [
“binary_sensor.studio_motion_sensor_1_occupancy”
],
“id”: “Studio Motion Sensor Off”,
“from”: “on”,
“to”: “off”,
“for”: {
“hours”: 0,
“minutes”: 5,
“seconds”: 0
}
}
],
“condition”: [],
“action”: [
{
“choose”: [
{
“conditions”: [
{
“condition”: “trigger”,
“id”: “Studio Motion Sensor On”
},
{
“condition”: “numeric_state”,
“entity_id”: “sensor.studio_motion_sensor_1_illuminance_lux”,
“above”: 0,
“below”: 80
}
],
“sequence”: [
{
“service”: “light.turn_on”,
“data”: {
“transition”: 2,
“brightness”: 135
},
“target”: {
“entity_id”: [
“light.studio_main_lights”,
“light.studio_red_lamp”
]
}
}
]
},
{
“conditions”: [
{
“condition”: “trigger”,
“id”: “Studio Motion Sensor Off”
}
],
“sequence”: [
{
“service”: “light.turn_off”,
“data”: {},
“target”: {
“entity_id”: [
“light.studio_main_lights”,
“light.studio_red_lamp”
]
}
}
]
}
]
}
],
“mode”: “single”
},
“blueprint_inputs”: null,
“context”: {
“id”: “01GKM3VTQDZK554YG1Q3ZRWKWE”,
“parent_id”: “01GKM3VTQCSYWD43FATMBMVSH0”,
“user_id”: null
}
},
“logbookEntries”: [
{
“name”: “Studio Lights Motion with ID’s”,
“message”: “triggered by state of binary_sensor.studio_motion_sensor_1_occupancy”,
“source”: “state of binary_sensor.studio_motion_sensor_1_occupancy”,
“entity_id”: “automation.studio_lights_motion_with_id_s”,
“context_id”: “01GKM3VTQDZK554YG1Q3ZRWKWE”,
“when”: 1670343682.797619,
“domain”: “automation”
}
]
}

Your trace shows what condition is failing. Hint: It’s your lux sensor. The reading was 87.

Thanks so much Petro. I appreciate your time.

I find it odd that during the day when the sun is up but it’s cloudy outside the automation works 100% of the time. But when it’s pitch black in the morning is reads a lux of 87. Does not seem right to me.
I’ll experiment with that tonight and report back here.

Have a good evening.

Ok so I think I sent the wrong trace in my previous trace post.

Here is one from this morning.

I can see the same type of error but this time it does not say what the sensor is that caused the automation to complete without choosing one of the two options.
Can someone please shed some light?

I have posted the entire trace below but here is the section I mentioned…

"path": “action/0/choose/0/conditions/1/entity_id/0”,
** “timestamp”: “2022-12-07T06:03:29.434805+00:00”,**
** “result”: {**
** “result”: false,**
** “state”: 0,**
** “wanted_state_above”: 0**

Full trace below…

{
“trace”: {
“last_step”: “action/0/choose/1/conditions/0”,
“run_id”: “c0fa7579d20b76d14e2c29e14628eb3f”,
“state”: “stopped”,
“script_execution”: “finished”,
“timestamp”: {
“start”: “2022-12-07T06:03:29.432212+00:00”,
“finish”: “2022-12-07T06:03:29.441176+00:00”
},
“domain”: “automation”,
“item_id”: “1667330095647”,
“trigger”: “state of binary_sensor.studio_motion_sensor_1_occupancy”,
“trace”: {
“trigger/0”: [
{
“path”: “trigger/0”,
“timestamp”: “2022-12-07T06:03:29.432382+00:00”,
“changed_variables”: {
“this”: {
“entity_id”: “automation.studio_lights_motion_with_id_s”,
“state”: “on”,
“attributes”: {
“last_triggered”: “2022-12-07T06:00:46.143155+00:00”,
“mode”: “single”,
“current”: 0,
“id”: “1667330095647”,
“friendly_name”: “Studio Lights Motion with ID’s”
},
“last_changed”: “2022-12-06T00:25:46.847139+00:00”,
“last_updated”: “2022-12-07T06:00:46.147643+00:00”,
“context”: {
“id”: “01GKNJR5SYDP2KCFV6TZYSEC4V”,
“parent_id”: “01GKNJR5SX8RHH10XAB4T38HH7”,
“user_id”: null
}
},
“trigger”: {
“id”: “Studio Motion Sensor On”,
“idx”: “0”,
“alias”: null,
“platform”: “state”,
“entity_id”: “binary_sensor.studio_motion_sensor_1_occupancy”,
“from_state”: {
“entity_id”: “binary_sensor.studio_motion_sensor_1_occupancy”,
“state”: “off”,
“attributes”: {
“device_class”: “motion”,
“friendly_name”: “Studio Motion Sensor 1 occupancy”
},
“last_changed”: “2022-12-07T06:02:36.446397+00:00”,
“last_updated”: “2022-12-07T06:02:36.446397+00:00”,
“context”: {
“id”: “01GKNJVHGYCNXEZPN8SZD9KHW9”,
“parent_id”: null,
“user_id”: null
}
},
“to_state”: {
“entity_id”: “binary_sensor.studio_motion_sensor_1_occupancy”,
“state”: “on”,
“attributes”: {
“device_class”: “motion”,
“friendly_name”: “Studio Motion Sensor 1 occupancy”
},
“last_changed”: “2022-12-07T06:03:29.426575+00:00”,
“last_updated”: “2022-12-07T06:03:29.426575+00:00”,
“context”: {
“id”: “01GKNJX58JWZTHHQTRWTH8N7T1”,
“parent_id”: null,
“user_id”: null
}
},
“for”: null,
“attribute”: null,
“description”: “state of binary_sensor.studio_motion_sensor_1_occupancy”
}
}
}
],
“action/0”: [
{
“path”: “action/0”,
“timestamp”: “2022-12-07T06:03:29.433998+00:00”,
“changed_variables”: {
“context”: {
“id”: “01GKNJX58RSFJNSKY5VYQTYGVM”,
“parent_id”: “01GKNJX58JWZTHHQTRWTH8N7T1”,
“user_id”: null
}
}
}
],
“action/0/choose/0”: [
{
“path”: “action/0/choose/0”,
“timestamp”: “2022-12-07T06:03:29.434197+00:00”,
“result”: {
“result”: false
}
}
],
“action/0/choose/0/conditions/0”: [
{
“path”: “action/0/choose/0/conditions/0”,
“timestamp”: “2022-12-07T06:03:29.434728+00:00”,
“result”: {
“result”: true
}
}
],
“action/0/choose/0/conditions/1”: [
{
“path”: “action/0/choose/0/conditions/1”,
“timestamp”: “2022-12-07T06:03:29.434787+00:00”,
“result”: {
“result”: false
}
}
],
“action/0/choose/0/conditions/1/entity_id/0”: [
{
“path”: “action/0/choose/0/conditions/1/entity_id/0”,
“timestamp”: “2022-12-07T06:03:29.434805+00:00”,
“result”: {
“result”: false,
“state”: 0,
“wanted_state_above”: 0
}
}
],
“action/0/choose/1”: [
{
“path”: “action/0/choose/1”,
“timestamp”: “2022-12-07T06:03:29.434872+00:00”,
“result”: {
“result”: false
}
}
],
“action/0/choose/1/conditions/0”: [
{
“path”: “action/0/choose/1/conditions/0”,
“timestamp”: “2022-12-07T06:03:29.434886+00:00”,
“result”: {
“result”: false
}
}
]
},
“config”: {
“id”: “1667330095647”,
“alias”: “Studio Lights Motion with ID’s”,
“description”: “”,
“trigger”: [
{
“platform”: “state”,
“entity_id”: [
“binary_sensor.studio_motion_sensor_1_occupancy”
],
“id”: “Studio Motion Sensor On”,
“from”: “off”,
“to”: “on”
},
{
“platform”: “state”,
“entity_id”: [
“binary_sensor.studio_motion_sensor_1_occupancy”
],
“id”: “Studio Motion Sensor Off”,
“from”: “on”,
“to”: “off”,
“for”: {
“hours”: 0,
“minutes”: 5,
“seconds”: 0
}
}
],
“condition”: [],
“action”: [
{
“choose”: [
{
“conditions”: [
{
“condition”: “trigger”,
“id”: “Studio Motion Sensor On”
},
{
“condition”: “numeric_state”,
“entity_id”: “sensor.studio_motion_sensor_1_illuminance_lux”,
“above”: 0,
“below”: 80
}
],
“sequence”: [
{
“service”: “light.turn_on”,
“data”: {
“transition”: 2,
“brightness”: 135
},
“target”: {
“entity_id”: [
“light.studio_main_lights”,
“light.studio_red_lamp”
]
}
}
]
},
{
“conditions”: [
{
“condition”: “trigger”,
“id”: “Studio Motion Sensor Off”
}
],
“sequence”: [
{
“service”: “light.turn_off”,
“data”: {},
“target”: {
“entity_id”: [
“light.studio_main_lights”,
“light.studio_red_lamp”
]
}
}
]
}
]
}
],
“mode”: “single”
},
“blueprint_inputs”: null,
“context”: {
“id”: “01GKNJX58RSFJNSKY5VYQTYGVM”,
“parent_id”: “01GKNJX58JWZTHHQTRWTH8N7T1”,
“user_id”: null
}
},
“logbookEntries”: [
{
“name”: “Studio Lights Motion with ID’s”,
“message”: “triggered by state of binary_sensor.studio_motion_sensor_1_occupancy”,
“source”: “state of binary_sensor.studio_motion_sensor_1_occupancy”,
“entity_id”: “automation.studio_lights_motion_with_id_s”,
“context_id”: “01GKNJX58RSFJNSKY5VYQTYGVM”,
“when”: 1670393009.432495,
“domain”: “automation”
}
]
}

This one seems to fail on above: 0 when lux is actually 0. That fits your description that it fails when it’s pitch dark.

You should leave the above value empty if there is no lower limit (or remove that line from the yaml).

1 Like

Great! Thanks Edwin.

I hoped there was a simple solution.

I’ll try that tonight and report back.

For future reference, above: 0 literally means any value greater than 0. In other words, it doesn’t mean greater than or equal to 0.

The sensor’s value was 0 so that’s why the Numeric State Condition evaluated to false.

When you said the room was dark, you weren’t kidding. :slightly_smiling_face:

Makes sense, thanks.
I have not seen that mentioned anywhere in my online searches, and believe me there have been many!

I’ll keep this info in mind when using numerical values for any entity in the future.

Cheers.

Success!

All automations worked as expected now.

Thanks to all who commented. I have a much better understanding now.

Have a great rest of your week.

2 Likes