Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- {
- "trace": {
- "last_step": "action/1/choose/0/conditions/0",
- "run_id": "05415396489b857e6a7b7dda5a3c5c05",
- "state": "stopped",
- "script_execution": "finished",
- "timestamp": {
- "start": "2025-07-22T01:48:33.095013+00:00",
- "finish": "2025-07-22T01:48:33.095869+00:00"
- },
- "domain": "automation",
- "item_id": "1753142425041",
- "trigger": "state of input_button.test_button",
- "trace": {
- "trigger/0": [
- {
- "path": "trigger/0",
- "timestamp": "2025-07-22T01:48:33.095059+00:00",
- "changed_variables": {
- "this": {
- "entity_id": "automation.check_doors_are_locked",
- "state": "on",
- "attributes": {
- "id": "1753142425041",
- "last_triggered": "2025-07-22T01:46:59.208049+00:00",
- "mode": "single",
- "current": 0,
- "friendly_name": "Check Doors Are Locked"
- },
- "last_changed": "2025-07-22T01:48:26.734782+00:00",
- "last_reported": "2025-07-22T01:48:26.734782+00:00",
- "last_updated": "2025-07-22T01:48:26.734782+00:00",
- "context": {
- "id": "01K0QX2Q7EYT6QVGDGBP4F3V7J",
- "parent_id": null,
- "user_id": null
- }
- },
- "trigger": {
- "id": "0",
- "idx": "0",
- "alias": null,
- "platform": "state",
- "entity_id": "input_button.test_button",
- "from_state": {
- "entity_id": "input_button.test_button",
- "state": "2025-07-22T01:46:59.207675+00:00",
- "attributes": {
- "editable": true,
- "icon": "mdi:button-cursor",
- "friendly_name": "Test Button"
- },
- "last_changed": "2025-07-22T01:46:59.207694+00:00",
- "last_reported": "2025-07-22T01:46:59.207694+00:00",
- "last_updated": "2025-07-22T01:46:59.207694+00:00",
- "context": {
- "id": "01K0QX01R7HNGW94EY4P3VE43Q",
- "parent_id": null,
- "user_id": "c7cd930bed5d41e69297fb1a49b727ca"
- }
- },
- "to_state": {
- "entity_id": "input_button.test_button",
- "state": "2025-07-22T01:48:33.094468+00:00",
- "attributes": {
- "editable": true,
- "icon": "mdi:button-cursor",
- "friendly_name": "Test Button"
- },
- "last_changed": "2025-07-22T01:48:33.094491+00:00",
- "last_reported": "2025-07-22T01:48:33.094491+00:00",
- "last_updated": "2025-07-22T01:48:33.094491+00:00",
- "context": {
- "id": "01K0QX2XE6FR5YKJDQDDRWY0HC",
- "parent_id": null,
- "user_id": "c7cd930bed5d41e69297fb1a49b727ca"
- }
- },
- "for": null,
- "attribute": null,
- "description": "state of input_button.test_button"
- }
- }
- }
- ],
- "action/0": [
- {
- "path": "action/0",
- "timestamp": "2025-07-22T01:48:33.095333+00:00",
- "changed_variables": {
- "context": {
- "id": "01K0QX2XE6GNVDW487WZ5GK4ZN",
- "parent_id": "01K0QX2XE6FR5YKJDQDDRWY0HC",
- "user_id": null
- },
- "unlocked_doors": []
- }
- }
- ],
- "action/1": [
- {
- "path": "action/1",
- "timestamp": "2025-07-22T01:48:33.095550+00:00"
- }
- ],
- "action/1/choose/0": [
- {
- "path": "action/1/choose/0",
- "timestamp": "2025-07-22T01:48:33.095600+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "action/1/choose/0/conditions/0": [
- {
- "path": "action/1/choose/0/conditions/0",
- "timestamp": "2025-07-22T01:48:33.095614+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ]
- },
- "config": {
- "id": "1753142425041",
- "alias": "Check Doors Are Locked",
- "description": "",
- "triggers": [
- {
- "trigger": "state",
- "entity_id": [
- "input_button.test_button"
- ]
- }
- ],
- "conditions": [],
- "actions": [
- {
- "variables": {
- "unlocked_doors": "{% set unlocked = [] %}\n{% for lock_entity in states.lock %}\n {% if state_attr(lock_entity.entity_id, 'lock_state') == 'unlocked' or states(lock_entity.entity_id) == 'unlocked' %} \n {% set unlocked = unlocked + [state_attr(lock_entity.entity_id, 'friendly_name') | default(lock_entity.entity_id.split('.')[1] | replace('_', ' ') | title)] %}\n {% endif %}\n{% endfor %} \n{{ unlocked }}\n \n"
- }
- },
- {
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ unlocked_doors | length > 0 }}"
- }
- ],
- "sequence": [
- {
- "action": "assist_satellite.ask_question",
- "metadata": {},
- "data": {
- "question": "{% if unlocked_doors | length == 1 %}\n It looks like the {{ unlocked_doors[0] }} is unlocked. Would you like me to lock it?\n{% else %}\n It looks like these doors are unlocked: {{ unlocked_doors | join(', ') }}. Would you like me to lock them?\n{% endif %}\n",
- "preannounce": true,
- "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite",
- "answers": [
- {
- "id": "yes_lock",
- "sentences": [
- "yes",
- "please lock them",
- "lock them",
- "yeah",
- "affirmative"
- ]
- },
- {
- "id": "no_dont_lock",
- "sentences": [
- "no",
- "don't lock them",
- "leave them",
- "negative"
- ]
- }
- ],
- "response_variable": "door_lock_response"
- },
- "continue_on_error": true
- },
- {
- "choose": [
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ door_lock_response.id == 'yes_lock' }}"
- }
- ],
- "sequence": [
- {
- "action": "lock.lock",
- "metadata": {},
- "data": {},
- "target": {
- "entity_id": "{% set lock_entities = [] %} {% for door_name in unlocked_doors %}\n {% for entity_id in states.lock %}\n {% if state_attr(entity_id, 'friendly_name') == door_name or entity_id.split('.')[1] | replace('_', ' ') | title == door_name %}\n {% set lock_entities = lock_entities + [entity_id] %}\n {% endif %}\n {% endfor %}\n{% endfor %} {{ lock_entities }}\n"
- }
- },
- {
- "action": "assist_satellite.announce",
- "metadata": {},
- "data": {
- "message": "\"Okay, I'm locking the doors.\"",
- "preannounce": true
- },
- "target": {
- "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
- }
- }
- ]
- },
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ door_lock_response.id == 'no_dont_lock' }}"
- }
- ],
- "sequence": [
- {
- "action": "assist_satellite.announce",
- "metadata": {},
- "data": {
- "message": "Understood. I will not lock them.",
- "preannounce": true
- },
- "target": {
- "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
- }
- }
- ]
- },
- {
- "conditions": [
- {
- "condition": "template",
- "value_template": "{{ door_lock_response.id is none }}"
- }
- ],
- "sequence": [
- {
- "action": "assist_satellite.announce",
- "metadata": {},
- "data": {
- "message": "I didn't catch that. Please check your doors.",
- "preannounce": true
- },
- "target": {
- "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
- }
- }
- ]
- }
- ],
- "default": [
- {
- "action": "assist_satellite.announce",
- "metadata": {},
- "data": {
- "message": "All doors are currently locked",
- "preannounce": true
- },
- "target": {
- "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ],
- "mode": "single"
- },
- "blueprint_inputs": null,
- "context": {
- "id": "01K0QX2XE6GNVDW487WZ5GK4ZN",
- "parent_id": "01K0QX2XE6FR5YKJDQDDRWY0HC",
- "user_id": null
- }
- },
- "logbookEntries": []
- }
Advertisement
Add Comment
Please, Sign In to add comment