Aha - learned something new there… thanks!
Here’s a recent download of morning automation that shouldn’t have run:
{
"trace": {
"last_step": "action/3",
"run_id": "1788",
"state": "stopped",
"script_execution": "cancelled",
"timestamp": {
"start": "2021-10-10T11:58:26.775245+00:00",
"finish": "2021-10-10T12:00:15.690681+00:00"
},
"domain": "automation",
"item_id": "1631092861494",
"trigger": "state of input_boolean.living_room_room_occupancy",
"trace": {
"trigger/0": [
{
"path": "trigger/0",
"timestamp": "2021-10-10T11:58:26.775492+00:00",
"changed_variables": {
"target_entity": "light.living_room_lights",
"illuminance_currently": "sensor.living_room_motion_illuminance_lux",
"illuminance_cutoff": 80,
"blocker_entity": "input_boolean.lights_manual_mode",
"time_limit_before": "input_datetime.morning_ends",
"time_limit_after": "input_datetime.wakey_time",
"no_motion_wait": 300,
"turn_off_blocker_entity": "group.morning_or_evening",
"target_off_entity": null,
"target_off_action": null,
"this": {
"entity_id": "automation.living_room_lights_on_motion_or_lux",
"state": "on",
"attributes": {
"last_triggered": "2021-10-10T11:55:38.324610+00:00",
"mode": "restart",
"current": 1,
"id": "1631092861494",
"friendly_name": "Living Room Lights Morning On Motion or Lux"
},
"last_changed": "2021-10-10T06:36:21.811953+00:00",
"last_updated": "2021-10-10T11:55:38.324946+00:00",
"context": {
"id": "4bbb92b948200fbd2ef71e6f1590f2ec",
"parent_id": "9997918a2ff7527e2730b68aef245ebc",
"user_id": null
}
},
"trigger": {
"id": "0",
"idx": "0",
"platform": "state",
"entity_id": "input_boolean.living_room_room_occupancy",
"from_state": {
"entity_id": "input_boolean.living_room_room_occupancy",
"state": "off",
"attributes": {
"editable": true,
"friendly_name": "Living Room Room Occupancy",
"icon": "hass:walk"
},
"last_changed": "2021-10-10T11:58:18.093502+00:00",
"last_updated": "2021-10-10T11:58:18.093502+00:00",
"context": {
"id": "1138bf6ac1804fcab13b6618d96c674b",
"parent_id": "f5a9412f694ad37c209cd4b54ad90ec8",
"user_id": null
}
},
"to_state": {
"entity_id": "input_boolean.living_room_room_occupancy",
"state": "on",
"attributes": {
"editable": true,
"friendly_name": "Living Room Room Occupancy",
"icon": "hass:walk"
},
"last_changed": "2021-10-10T11:58:26.773383+00:00",
"last_updated": "2021-10-10T11:58:26.773383+00:00",
"context": {
"id": "307c2605b275c38e10398b8b7377f825",
"parent_id": "c46bdb3111b04c76cea8bb5770419f2b",
"user_id": null
}
},
"for": null,
"attribute": null,
"description": "state of input_boolean.living_room_room_occupancy"
}
}
}
],
"condition/0": [
{
"path": "condition/0",
"timestamp": "2021-10-10T11:58:26.775589+00:00",
"result": {
"result": true,
"entities": [
"light.living_room_lights"
]
}
}
],
"condition/1": [
{
"path": "condition/1",
"timestamp": "2021-10-10T11:58:26.776133+00:00",
"result": {
"result": true,
"entities": [
"input_boolean.lights_manual_mode"
]
}
}
],
"condition/2": [
{
"path": "condition/2",
"timestamp": "2021-10-10T11:58:26.776393+00:00",
"result": {
"result": true,
"entities": [
"input_datetime.morning_ends",
"input_datetime.wakey_time"
]
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2021-10-10T11:58:26.790004+00:00",
"changed_variables": {
"context": {
"id": "5b5537bf347e2b7c77b70e17509d785f",
"parent_id": "307c2605b275c38e10398b8b7377f825",
"user_id": null
}
},
"result": {
"params": {
"domain": "homeassistant",
"service": "turn_on",
"service_data": {},
"target": {
"entity_id": [
"light.living_room_lights"
]
}
},
"running_script": false,
"limit": 10
}
}
],
"action/1": [
{
"path": "action/1",
"timestamp": "2021-10-10T11:58:26.834071+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/2": [
{
"path": "action/2",
"timestamp": "2021-10-10T11:58:26.834751+00:00",
"result": {
"wait": {
"remaining": null,
"trigger": {
"id": "0",
"idx": "0",
"platform": "state",
"entity_id": "input_boolean.living_room_room_occupancy",
"from_state": {
"entity_id": "input_boolean.living_room_room_occupancy",
"state": "on",
"attributes": {
"editable": true,
"friendly_name": "Living Room Room Occupancy",
"icon": "hass:walk"
},
"last_changed": "2021-10-10T11:58:26.773383+00:00",
"last_updated": "2021-10-10T11:58:26.773383+00:00",
"context": {
"id": "307c2605b275c38e10398b8b7377f825",
"parent_id": "c46bdb3111b04c76cea8bb5770419f2b",
"user_id": null
}
},
"to_state": {
"entity_id": "input_boolean.living_room_room_occupancy",
"state": "off",
"attributes": {
"editable": true,
"friendly_name": "Living Room Room Occupancy",
"icon": "hass:walk"
},
"last_changed": "2021-10-10T11:59:56.770900+00:00",
"last_updated": "2021-10-10T11:59:56.770900+00:00",
"context": {
"id": "2c6c6bd04eb6c0c1a034ff7eeb873753",
"parent_id": "440ab2df53955575e28d7ca73e8d9fe9",
"user_id": null
}
},
"for": null,
"attribute": null,
"description": "state of input_boolean.living_room_room_occupancy"
}
}
}
}
],
"action/3": [
{
"path": "action/3",
"timestamp": "2021-10-10T11:59:56.778242+00:00",
"changed_variables": {
"wait": {
"remaining": null,
"trigger": {
"id": "0",
"idx": "0",
"platform": "state",
"entity_id": "input_boolean.living_room_room_occupancy",
"from_state": {
"entity_id": "input_boolean.living_room_room_occupancy",
"state": "on",
"attributes": {
"editable": true,
"friendly_name": "Living Room Room Occupancy",
"icon": "hass:walk"
},
"last_changed": "2021-10-10T11:58:26.773383+00:00",
"last_updated": "2021-10-10T11:58:26.773383+00:00",
"context": {
"id": "307c2605b275c38e10398b8b7377f825",
"parent_id": "c46bdb3111b04c76cea8bb5770419f2b",
"user_id": null
}
},
"to_state": {
"entity_id": "input_boolean.living_room_room_occupancy",
"state": "off",
"attributes": {
"editable": true,
"friendly_name": "Living Room Room Occupancy",
"icon": "hass:walk"
},
"last_changed": "2021-10-10T11:59:56.770900+00:00",
"last_updated": "2021-10-10T11:59:56.770900+00:00",
"context": {
"id": "2c6c6bd04eb6c0c1a034ff7eeb873753",
"parent_id": "440ab2df53955575e28d7ca73e8d9fe9",
"user_id": null
}
},
"for": null,
"attribute": null,
"description": "state of input_boolean.living_room_room_occupancy"
}
}
},
"result": {
"delay": 300,
"done": false
}
}
]
},
"config": {
"mode": "restart",
"max_exceeded": "silent",
"variables": {
"target_entity": "light.living_room_lights",
"illuminance_currently": "sensor.living_room_motion_illuminance_lux",
"illuminance_cutoff": 80,
"blocker_entity": "input_boolean.lights_manual_mode",
"time_limit_before": "input_datetime.morning_ends",
"time_limit_after": "input_datetime.wakey_time",
"no_motion_wait": 300,
"turn_off_blocker_entity": "group.morning_or_evening",
"target_off_entity": null,
"target_off_action": null
},
"trigger": {
"platform": "state",
"entity_id": "input_boolean.living_room_room_occupancy",
"to": "on"
},
"condition": [
{
"condition": "template",
"value_template": "{{ (states(target_entity) == 'on') or (illuminance_currently == none) or (illuminance_cutoff == none) or (states[illuminance_currently].state | int < illuminance_cutoff | int) }}"
},
{
"condition": "template",
"value_template": "{{ (blocker_entity == none) or (states[blocker_entity].state == 'off') }}"
},
{
"condition": "template",
"value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before != none and time_limit_after == none %} {{ states[time_limit_before].state > current_time }} {% elif time_limit_before == none and time_limit_after != none %} {{ states[time_limit_after].state < current_time }} {% elif time_limit_before != none and time_limit_after != none %} {% set before_limit_is_on_next_day = time_limit_after > time_limit_before %} {% if not before_limit_is_on_next_day %} {{ (states[time_limit_after].state < current_time) and (states[time_limit_before].state > current_time) }} {% elif before_limit_is_on_next_day %} {{ (states[time_limit_before].state > current_time) or (states[time_limit_after].state < current_time) }} {% endif %} {% else %} true {% endif %}\n"
}
],
"action": [
{
"service": "homeassistant.turn_on",
"entity_id": "light.living_room_lights"
},
{
"condition": "template",
"value_template": "{{ no_motion_wait != none }}"
},
{
"wait_for_trigger": {
"platform": "state",
"entity_id": "input_boolean.living_room_room_occupancy",
"from": "on",
"to": "off"
}
},
{
"delay": {
"seconds": "{{ no_motion_wait | int }}"
}
},
{
"condition": "template",
"value_template": "{{ (turn_off_blocker_entity == none) or (states[turn_off_blocker_entity].state == 'off') }}"
},
{
"choose": [
{
"conditions": [
{
"condition": "template",
"value_template": "{{ (target_off_entity != none) }}"
}
],
"sequence": [
{
"service": "homeassistant.turn_off",
"entity_id": null
}
]
},
{
"conditions": [
{
"condition": "template",
"value_template": "{{ (target_off_action != none) }}"
}
],
"sequence": null
}
],
"default": [
{
"service": "homeassistant.turn_off",
"entity_id": "light.living_room_lights"
}
]
}
],
"id": "1631092861494",
"alias": "Living Room Lights Morning On Motion or Lux",
"description": ""
},
"blueprint_inputs": {
"id": "1631092861494",
"alias": "Living Room Lights Morning On Motion or Lux",
"description": "",
"use_blueprint": {
"path": "apollo1220/motion_activated_entity.yaml",
"input": {
"motion_sensor": "input_boolean.living_room_room_occupancy",
"target_entity": "light.living_room_lights",
"no_motion_wait": 300,
"illuminance_sensor": "sensor.living_room_motion_illuminance_lux",
"turn_off_blocker_entity": "group.morning_or_evening",
"illuminance_cutoff": 80,
"time_limit_after": "input_datetime.wakey_time",
"time_limit_before": "input_datetime.morning_ends",
"blocker_entity": "input_boolean.lights_manual_mode"
}
}
},
"context": {
"id": "5b5537bf347e2b7c77b70e17509d785f",
"parent_id": "307c2605b275c38e10398b8b7377f825",
"user_id": null
}
},
"logbookEntries": [
{
"name": "Living Room Lights Morning On Motion or Lux",
"message": "has been triggered by state of input_boolean.living_room_room_occupancy",
"source": "state of input_boolean.living_room_room_occupancy",
"entity_id": "automation.living_room_lights_on_motion_or_lux",
"context_id": "5b5537bf347e2b7c77b70e17509d785f",
"when": "2021-10-10T11:58:26.787775+00:00",
"domain": "automation"
}
]
}
Grateful if you can point me in the right direction with fault finding. Also I don’t see any personally identifiable information but if there is please let me know and I’ll strip out asap!!
Thanks again