photo64

Trace_Formatted

Jul 22nd, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.99 KB | None | 0 0
  1. ```
  2. {
  3. "trace": {
  4. "last_step": "action/1/choose/0/conditions/0",
  5. "run_id": "05415396489b857e6a7b7dda5a3c5c05",
  6. "state": "stopped",
  7. "script_execution": "finished",
  8. "timestamp": {
  9. "start": "2025-07-22T01:48:33.095013+00:00",
  10. "finish": "2025-07-22T01:48:33.095869+00:00"
  11. },
  12. "domain": "automation",
  13. "item_id": "1753142425041",
  14. "trigger": "state of input_button.test_button",
  15. "trace": {
  16. "trigger/0": [
  17. {
  18. "path": "trigger/0",
  19. "timestamp": "2025-07-22T01:48:33.095059+00:00",
  20. "changed_variables": {
  21. "this": {
  22. "entity_id": "automation.check_doors_are_locked",
  23. "state": "on",
  24. "attributes": {
  25. "id": "1753142425041",
  26. "last_triggered": "2025-07-22T01:46:59.208049+00:00",
  27. "mode": "single",
  28. "current": 0,
  29. "friendly_name": "Check Doors Are Locked"
  30. },
  31. "last_changed": "2025-07-22T01:48:26.734782+00:00",
  32. "last_reported": "2025-07-22T01:48:26.734782+00:00",
  33. "last_updated": "2025-07-22T01:48:26.734782+00:00",
  34. "context": {
  35. "id": "01K0QX2Q7EYT6QVGDGBP4F3V7J",
  36. "parent_id": null,
  37. "user_id": null
  38. }
  39. },
  40. "trigger": {
  41. "id": "0",
  42. "idx": "0",
  43. "alias": null,
  44. "platform": "state",
  45. "entity_id": "input_button.test_button",
  46. "from_state": {
  47. "entity_id": "input_button.test_button",
  48. "state": "2025-07-22T01:46:59.207675+00:00",
  49. "attributes": {
  50. "editable": true,
  51. "icon": "mdi:button-cursor",
  52. "friendly_name": "Test Button"
  53. },
  54. "last_changed": "2025-07-22T01:46:59.207694+00:00",
  55. "last_reported": "2025-07-22T01:46:59.207694+00:00",
  56. "last_updated": "2025-07-22T01:46:59.207694+00:00",
  57. "context": {
  58. "id": "01K0QX01R7HNGW94EY4P3VE43Q",
  59. "parent_id": null,
  60. "user_id": "c7cd930bed5d41e69297fb1a49b727ca"
  61. }
  62. },
  63. "to_state": {
  64. "entity_id": "input_button.test_button",
  65. "state": "2025-07-22T01:48:33.094468+00:00",
  66. "attributes": {
  67. "editable": true,
  68. "icon": "mdi:button-cursor",
  69. "friendly_name": "Test Button"
  70. },
  71. "last_changed": "2025-07-22T01:48:33.094491+00:00",
  72. "last_reported": "2025-07-22T01:48:33.094491+00:00",
  73. "last_updated": "2025-07-22T01:48:33.094491+00:00",
  74. "context": {
  75. "id": "01K0QX2XE6FR5YKJDQDDRWY0HC",
  76. "parent_id": null,
  77. "user_id": "c7cd930bed5d41e69297fb1a49b727ca"
  78. }
  79. },
  80. "for": null,
  81. "attribute": null,
  82. "description": "state of input_button.test_button"
  83. }
  84. }
  85. }
  86. ],
  87. "action/0": [
  88. {
  89. "path": "action/0",
  90. "timestamp": "2025-07-22T01:48:33.095333+00:00",
  91. "changed_variables": {
  92. "context": {
  93. "id": "01K0QX2XE6GNVDW487WZ5GK4ZN",
  94. "parent_id": "01K0QX2XE6FR5YKJDQDDRWY0HC",
  95. "user_id": null
  96. },
  97. "unlocked_doors": []
  98. }
  99. }
  100. ],
  101. "action/1": [
  102. {
  103. "path": "action/1",
  104. "timestamp": "2025-07-22T01:48:33.095550+00:00"
  105. }
  106. ],
  107. "action/1/choose/0": [
  108. {
  109. "path": "action/1/choose/0",
  110. "timestamp": "2025-07-22T01:48:33.095600+00:00",
  111. "result": {
  112. "result": false
  113. }
  114. }
  115. ],
  116. "action/1/choose/0/conditions/0": [
  117. {
  118. "path": "action/1/choose/0/conditions/0",
  119. "timestamp": "2025-07-22T01:48:33.095614+00:00",
  120. "result": {
  121. "result": false,
  122. "entities": []
  123. }
  124. }
  125. ]
  126. },
  127. "config": {
  128. "id": "1753142425041",
  129. "alias": "Check Doors Are Locked",
  130. "description": "",
  131. "triggers": [
  132. {
  133. "trigger": "state",
  134. "entity_id": [
  135. "input_button.test_button"
  136. ]
  137. }
  138. ],
  139. "conditions": [],
  140. "actions": [
  141. {
  142. "variables": {
  143. "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"
  144. }
  145. },
  146. {
  147. "choose": [
  148. {
  149. "conditions": [
  150. {
  151. "condition": "template",
  152. "value_template": "{{ unlocked_doors | length > 0 }}"
  153. }
  154. ],
  155. "sequence": [
  156. {
  157. "action": "assist_satellite.ask_question",
  158. "metadata": {},
  159. "data": {
  160. "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",
  161. "preannounce": true,
  162. "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite",
  163. "answers": [
  164. {
  165. "id": "yes_lock",
  166. "sentences": [
  167. "yes",
  168. "please lock them",
  169. "lock them",
  170. "yeah",
  171. "affirmative"
  172. ]
  173. },
  174. {
  175. "id": "no_dont_lock",
  176. "sentences": [
  177. "no",
  178. "don't lock them",
  179. "leave them",
  180. "negative"
  181. ]
  182. }
  183. ],
  184. "response_variable": "door_lock_response"
  185. },
  186. "continue_on_error": true
  187. },
  188. {
  189. "choose": [
  190. {
  191. "conditions": [
  192. {
  193. "condition": "template",
  194. "value_template": "{{ door_lock_response.id == 'yes_lock' }}"
  195. }
  196. ],
  197. "sequence": [
  198. {
  199. "action": "lock.lock",
  200. "metadata": {},
  201. "data": {},
  202. "target": {
  203. "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"
  204. }
  205. },
  206. {
  207. "action": "assist_satellite.announce",
  208. "metadata": {},
  209. "data": {
  210. "message": "\"Okay, I'm locking the doors.\"",
  211. "preannounce": true
  212. },
  213. "target": {
  214. "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
  215. }
  216. }
  217. ]
  218. },
  219. {
  220. "conditions": [
  221. {
  222. "condition": "template",
  223. "value_template": "{{ door_lock_response.id == 'no_dont_lock' }}"
  224. }
  225. ],
  226. "sequence": [
  227. {
  228. "action": "assist_satellite.announce",
  229. "metadata": {},
  230. "data": {
  231. "message": "Understood. I will not lock them.",
  232. "preannounce": true
  233. },
  234. "target": {
  235. "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
  236. }
  237. }
  238. ]
  239. },
  240. {
  241. "conditions": [
  242. {
  243. "condition": "template",
  244. "value_template": "{{ door_lock_response.id is none }}"
  245. }
  246. ],
  247. "sequence": [
  248. {
  249. "action": "assist_satellite.announce",
  250. "metadata": {},
  251. "data": {
  252. "message": "I didn't catch that. Please check your doors.",
  253. "preannounce": true
  254. },
  255. "target": {
  256. "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
  257. }
  258. }
  259. ]
  260. }
  261. ],
  262. "default": [
  263. {
  264. "action": "assist_satellite.announce",
  265. "metadata": {},
  266. "data": {
  267. "message": "All doors are currently locked",
  268. "preannounce": true
  269. },
  270. "target": {
  271. "entity_id": "assist_satellite.seeed_respeaker_satellite2_assist_satellite"
  272. }
  273. }
  274. ]
  275. }
  276. ]
  277. }
  278. ]
  279. }
  280. ],
  281. "mode": "single"
  282. },
  283. "blueprint_inputs": null,
  284. "context": {
  285. "id": "01K0QX2XE6GNVDW487WZ5GK4ZN",
  286. "parent_id": "01K0QX2XE6FR5YKJDQDDRWY0HC",
  287. "user_id": null
  288. }
  289. },
  290. "logbookEntries": []
  291. }
Advertisement
Add Comment
Please, Sign In to add comment