Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TBail/3fa228675f05b64d0f80d027026cab72 to your computer and use it in GitHub Desktop.
Save TBail/3fa228675f05b64d0f80d027026cab72 to your computer and use it in GitHub Desktop.
Homeassistant trace
{
"trace": {
"last_step": "action/2/then/0",
"run_id": "5dd02a894c197be2529deac79aa6184c",
"state": "running",
"script_execution": null,
"timestamp": {
"start": "2023-05-20T07:50:41.244914+00:00",
"finish": null
},
"domain": "automation",
"item_id": "1664390664892",
"trigger": "event 'pntc_event'",
"trace": {
"trigger/2": [
{
"path": "trigger/2",
"timestamp": "2023-05-20T07:50:41.245406+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.system_open_window_notification",
"state": "on",
"attributes": {
"last_triggered": "2023-05-20T07:40:41.205555+00:00",
"mode": "parallel",
"current": 1,
"max": 10,
"id": "1664390664892",
"friendly_name": "RE - Open window notification"
},
"last_changed": "2023-05-19T18:35:12.080735+00:00",
"last_updated": "2023-05-20T07:40:41.216779+00:00",
"context": {
"id": "01H0W1N0BM8GXVM6WV9Z7T6MT4",
"parent_id": "01H0W12PBX28JS3WTXP6J88316",
"user_id": null
}
},
"trigger": {
"id": "period",
"idx": "2",
"alias": null,
"platform": "event",
"event": {
"event_type": "pntc_event",
"data": {
"s_entity": "binary_sensor.abr_windows",
"automation": "automation.system_open_window_notification"
},
"origin": "LOCAL",
"time_fired": "2023-05-20T07:50:41.244000+00:00",
"context": {
"id": "01H0W1N0BM8GXVM6WV9Z7T6MT4",
"parent_id": "01H0W12PBX28JS3WTXP6J88316",
"user_id": null
}
},
"description": "event 'pntc_event'"
},
"for_time_m": 10,
"for_time_m_t": 10,
"active_state": "on",
"sensor_entity": [
"binary_sensor.gt_windows",
"binary_sensor.of_windows",
"binary_sensor.kt_windows",
"binary_sensor.lr_windows",
"binary_sensor.mbr_windows",
"binary_sensor.mba_windows",
"binary_sensor.sba_windows",
"binary_sensor.nbr_windows",
"binary_sensor.gr_windows",
"binary_sensor.abr_windows"
],
"group_target": "window_open_notification_group",
"ha_notification": true,
"notify_device": null,
"period": 10,
"action_prefix": "STOP_automation.system_open_window_notification"
}
}
],
"condition/0": [
{
"path": "condition/0",
"timestamp": "2023-05-20T07:50:41.245543+00:00",
"result": {
"result": true
}
}
],
"condition/0/conditions/0": [
{
"path": "condition/0/conditions/0",
"timestamp": "2023-05-20T07:50:41.245591+00:00",
"result": {
"result": false,
"entities": []
}
}
],
"condition/0/conditions/1": [
{
"path": "condition/0/conditions/1",
"timestamp": "2023-05-20T07:50:41.245747+00:00",
"result": {
"result": false,
"entities": []
}
}
],
"condition/0/conditions/2": [
{
"path": "condition/0/conditions/2",
"timestamp": "2023-05-20T07:50:41.245895+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2023-05-20T07:50:41.250232+00:00",
"changed_variables": {
"context": {
"id": "01H0W27AAWB7V611A7W44X7996",
"parent_id": "01H0W1N0BM8GXVM6WV9Z7T6MT4",
"user_id": null
}
}
}
],
"action/1": [
{
"path": "action/1",
"timestamp": "2023-05-20T07:50:41.251237+00:00",
"changed_variables": {
"is_period_trigger": true,
"sensor": "binary_sensor.abr_windows",
"entity_name": "Fenster Aimies Zimmer",
"tag": "automation.system_open_window_notification-pesn-binary_sensor.abr_windows",
"action_tag": "STOP_automation.system_open_window_notification_binary_sensor.abr_windows"
},
"result": {
"choice": "then"
}
}
],
"action/1/if": [
{
"path": "action/1/if",
"timestamp": "2023-05-20T07:50:41.251349+00:00",
"result": {
"result": true
}
}
],
"action/1/if/condition/0": [
{
"path": "action/1/if/condition/0",
"timestamp": "2023-05-20T07:50:41.251440+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/1/then/0": [
{
"path": "action/1/then/0",
"timestamp": "2023-05-20T07:50:41.252404+00:00"
}
],
"action/1/then/0/if": [
{
"path": "action/1/then/0/if",
"timestamp": "2023-05-20T07:50:41.252548+00:00",
"result": {
"result": false
}
}
],
"action/1/then/0/if/condition/0": [
{
"path": "action/1/then/0/if/condition/0",
"timestamp": "2023-05-20T07:50:41.252605+00:00",
"result": {
"result": false,
"entities": []
}
}
],
"action/1/then/1": [
{
"path": "action/1/then/1",
"timestamp": "2023-05-20T07:50:41.252809+00:00",
"result": {
"choice": "then"
}
}
],
"action/1/then/1/if": [
{
"path": "action/1/then/1/if",
"timestamp": "2023-05-20T07:50:41.252889+00:00",
"result": {
"result": true
}
}
],
"action/1/then/1/if/condition/0": [
{
"path": "action/1/then/1/if/condition/0",
"timestamp": "2023-05-20T07:50:41.252936+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/1/then/1/then/0": [
{
"path": "action/1/then/1/then/0",
"timestamp": "2023-05-20T07:50:41.253635+00:00",
"result": {
"choice": "then"
}
}
],
"action/1/then/1/then/0/if": [
{
"path": "action/1/then/1/then/0/if",
"timestamp": "2023-05-20T07:50:41.253721+00:00",
"result": {
"result": true
}
}
],
"action/1/then/1/then/0/if/condition/0": [
{
"path": "action/1/then/1/then/0/if/condition/0",
"timestamp": "2023-05-20T07:50:41.253772+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/1/then/1/then/0/then/0": [
{
"path": "action/1/then/1/then/0/then/0",
"timestamp": "2023-05-20T07:50:41.255314+00:00",
"result": {
"params": {
"domain": "notify",
"service": "window_open_notification_group",
"service_data": {
"title": "Aimies Zimmer - Offene Fenster!",
"message": "Bitte an die offenen Fenster denken!",
"data": {
"ttl": 0,
"priority": "high",
"notification_icon": "mdi:window-open-variant",
"tag": "automation.system_open_window_notification-pesn-binary_sensor.abr_windows",
"persistent": false,
"sticky": false,
"actions": [
{
"action": "STOP_automation.system_open_window_notification_binary_sensor.abr_windows",
"title": "Erinnerung beenden"
}
]
}
},
"target": {}
},
"running_script": false,
"limit": 10
}
}
],
"action/1/then/2": [
{
"path": "action/1/then/2",
"timestamp": "2023-05-20T07:50:41.268113+00:00",
"result": {
"choice": "then"
}
}
],
"action/1/then/2/if": [
{
"path": "action/1/then/2/if",
"timestamp": "2023-05-20T07:50:41.268230+00:00",
"result": {
"result": true
}
}
],
"action/1/then/2/if/condition/0": [
{
"path": "action/1/then/2/if/condition/0",
"timestamp": "2023-05-20T07:50:41.268284+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/1/then/2/then/0": [
{
"path": "action/1/then/2/then/0",
"timestamp": "2023-05-20T07:50:41.269047+00:00",
"result": {
"params": {
"domain": "persistent_notification",
"service": "create",
"service_data": {
"title": "Aimies Zimmer - Offene Fenster!",
"message": "Bitte an die offenen Fenster denken!",
"notification_id": "automation.system_open_window_notification-pesn-binary_sensor.abr_windows"
},
"target": {}
},
"running_script": false,
"limit": 10
}
}
],
"action/2": [
{
"path": "action/2",
"timestamp": "2023-05-20T07:50:41.274114+00:00",
"result": {
"choice": "then"
}
}
],
"action/2/if": [
{
"path": "action/2/if",
"timestamp": "2023-05-20T07:50:41.274221+00:00",
"result": {
"result": true
}
}
],
"action/2/if/condition/0": [
{
"path": "action/2/if/condition/0",
"timestamp": "2023-05-20T07:50:41.274275+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/2/then/0": [
{
"path": "action/2/then/0",
"timestamp": "2023-05-20T07:50:41.274973+00:00",
"result": {
"wait": {
"remaining": 600,
"trigger": null
}
}
}
]
},
"config": {
"variables": {
"active_state": "on",
"sensor_entity": [
"binary_sensor.gt_windows",
"binary_sensor.of_windows",
"binary_sensor.kt_windows",
"binary_sensor.lr_windows",
"binary_sensor.mbr_windows",
"binary_sensor.mba_windows",
"binary_sensor.sba_windows",
"binary_sensor.nbr_windows",
"binary_sensor.gr_windows",
"binary_sensor.abr_windows"
],
"group_target": "window_open_notification_group",
"ha_notification": true,
"notify_device": null,
"period": 10,
"action_prefix": "STOP_{{this.entity_id}}"
},
"trigger_variables": {
"for_time_m": 10,
"for_time_m_t": "{{ for_time_m | default(0) | int }}"
},
"trigger": [
{
"platform": "state",
"entity_id": [
"binary_sensor.gt_windows",
"binary_sensor.of_windows",
"binary_sensor.kt_windows",
"binary_sensor.lr_windows",
"binary_sensor.mbr_windows",
"binary_sensor.mba_windows",
"binary_sensor.sba_windows",
"binary_sensor.nbr_windows",
"binary_sensor.gr_windows",
"binary_sensor.abr_windows"
],
"to": "on",
"for": {
"minutes": "{{ for_time_m_t }}"
},
"id": "on"
},
{
"platform": "state",
"entity_id": [
"binary_sensor.gt_windows",
"binary_sensor.of_windows",
"binary_sensor.kt_windows",
"binary_sensor.lr_windows",
"binary_sensor.mbr_windows",
"binary_sensor.mba_windows",
"binary_sensor.sba_windows",
"binary_sensor.nbr_windows",
"binary_sensor.gr_windows",
"binary_sensor.abr_windows"
],
"from": "on",
"id": "off"
},
{
"platform": "event",
"event_type": "pntc_event",
"id": "period"
}
],
"condition": [
{
"condition": "or",
"conditions": [
{
"condition": "template",
"value_template": "{{ trigger.id == 'on' }}"
},
{
"condition": "template",
"value_template": "{{ trigger.id == 'off' }}"
},
{
"condition": "template",
"value_template": "{{ trigger.id == 'period' and trigger.event.data.automation == this.entity_id }}"
}
]
}
],
"action": [
{
"variables": {
"is_period_trigger": "{{ trigger.id == 'period' }}",
"sensor": "{% if is_period_trigger %}\n {{ trigger.event.data.s_entity }}\n{% else %}\n {{ trigger.from_state.entity_id }}\n{% endif %}\n",
"entity_name": "{{ state_attr(sensor,'friendly_name') }}",
"tag": "{{ this.entity_id }}-pesn-{{ sensor }}",
"action_tag": "{{ action_prefix }}_{{ sensor }}"
}
},
{
"if": [
{
"condition": "template",
"value_template": "{{ is_period_trigger or trigger.to_state.state == active_state }}"
}
],
"then": [
{
"if": [
{
"condition": "template",
"value_template": "{{ notify_device != none }}"
}
],
"then": [
{
"if": [
{
"condition": "template",
"value_template": "{{ period > 0 }}"
}
],
"then": [
{
"service": "notify.mobile_app_{{ device_attr(notify_device, \"name\") | slugify }}",
"data": {
"title": "{{ area_name(sensor) }} - Offene Fenster!",
"message": "Bitte an die offenen Fenster denken!",
"data": {
"ttl": 0,
"priority": "high",
"notification_icon": "mdi:window-open-variant",
"tag": "{{ tag }}",
"persistent": false,
"sticky": false,
"actions": [
{
"action": "{{ action_tag }}",
"title": "Erinnerung beenden"
}
]
}
}
}
],
"else": [
{
"service": "notify.mobile_app_{{ device_attr(notify_device, \"name\") | slugify }}",
"data": {
"title": "{{ area_name(sensor) }} - Offene Fenster!",
"message": "Bitte an die offenen Fenster denken!",
"data": {
"ttl": 0,
"priority": "high",
"notification_icon": "mdi:window-open-variant",
"tag": "{{ tag }}",
"persistent": false,
"sticky": false
}
}
}
]
}
]
},
{
"if": [
{
"condition": "template",
"value_template": "{{ group_target is defined and group_target != '' }}"
}
],
"then": [
{
"if": [
{
"condition": "template",
"value_template": "{{ period > 0 }}"
}
],
"then": [
{
"service": "notify.{{ group_target }}",
"data": {
"title": "{{ area_name(sensor) }} - Offene Fenster!",
"message": "Bitte an die offenen Fenster denken!",
"data": {
"ttl": 0,
"priority": "high",
"notification_icon": "mdi:window-open-variant",
"tag": "{{ tag }}",
"persistent": false,
"sticky": false,
"actions": [
{
"action": "{{ action_tag }}",
"title": "Erinnerung beenden"
}
]
}
}
}
],
"else": [
{
"service": "notify.{{ group_target }}",
"data": {
"title": "{{ area_name(sensor) }} - Offene Fenster!",
"message": "Bitte an die offenen Fenster denken!",
"data": {
"ttl": 0,
"priority": "high",
"notification_icon": "mdi:window-open-variant",
"tag": "{{ tag }}",
"persistent": false,
"sticky": false
}
}
}
]
}
]
},
{
"if": [
{
"condition": "template",
"value_template": "{{ ha_notification }}"
}
],
"then": [
{
"service": "persistent_notification.create",
"data": {
"title": "{{ area_name(sensor) }} - Offene Fenster!",
"message": "Bitte an die offenen Fenster denken!",
"notification_id": "{{ tag }}"
}
}
]
}
],
"else": [
{
"service": "notify.notify",
"data": {
"data": {
"tag": "{{ tag }}",
"ttl": 0,
"priority": "high"
},
"message": "clear_notification"
}
},
{
"service": "persistent_notification.dismiss",
"data": {
"notification_id": "pesn-{{ trigger.entity_id }}"
}
}
]
},
{
"if": [
{
"condition": "template",
"value_template": "{{ period > 0 }}"
}
],
"then": [
{
"wait_for_trigger": [
{
"platform": "event",
"event_type": "mobile_app_notification_action",
"event_data": {
"action": "{{ action_tag }}"
}
}
],
"timeout": {
"minutes": "{{ period }}"
}
},
{
"if": [
{
"condition": "template",
"value_template": "{{ states(sensor) == active_state }}"
},
{
"condition": "template",
"value_template": "{{ wait.trigger == none }}"
}
],
"then": [
{
"event": "pntc_event",
"event_data": {
"s_entity": "{{ sensor }}",
"automation": "{{ this.entity_id }}"
}
}
]
}
]
}
],
"mode": "parallel",
"id": "1664390664892",
"alias": "RE - Open window notification",
"description": ""
},
"blueprint_inputs": {
"id": "1664390664892",
"alias": "RE - Open window notification",
"description": "",
"use_blueprint": {
"path": "panhans/entity_state_persistent_norification.yaml",
"input": {
"for_time_m": 10,
"sensor_entity": [
"binary_sensor.gt_windows",
"binary_sensor.of_windows",
"binary_sensor.kt_windows",
"binary_sensor.lr_windows",
"binary_sensor.mbr_windows",
"binary_sensor.mba_windows",
"binary_sensor.sba_windows",
"binary_sensor.nbr_windows",
"binary_sensor.gr_windows",
"binary_sensor.abr_windows"
],
"title": "{{ area_name(sensor) }} - Offene Fenster!",
"notify_group": "window_open_notification_group",
"status_bar_icon": "mdi:window-open-variant",
"ha_notification": true,
"persistent_notification": false,
"period": 10,
"stop_button_text": "Erinnerung beenden",
"message": "Bitte an die offenen Fenster denken!"
}
}
},
"context": {
"id": "01H0W27AAWB7V611A7W44X7996",
"parent_id": "01H0W1N0BM8GXVM6WV9Z7T6MT4",
"user_id": null
}
},
"logbookEntries": [
{
"name": "RE - Open window notification",
"message": "triggered by event 'pntc_event'",
"source": "event 'pntc_event'",
"entity_id": "automation.system_open_window_notification",
"context_id": "01H0W27AAWB7V611A7W44X7996",
"when": 1684569041.246189,
"domain": "automation"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment