Here is the trace, I can see that the if action returns false but I still have the persistent notification.
{
"trace": {
"last_step": "action/1/if/condition/0",
"run_id": "0d59b683279dacb11ff6002b296e53af",
"state": "stopped",
"script_execution": "finished",
"timestamp": {
"start": "2023-08-29T06:14:19.739457+00:00",
"finish": "2023-08-29T06:14:19.770190+00:00"
},
"domain": "automation",
"item_id": "1686833960430",
"trigger": "state of var.estado_backup_local",
"trace": {
"trigger/0": [
{
"path": "trigger/0",
"timestamp": "2023-08-29T06:14:19.739685+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.telegram_mensaje_backup_mayoral",
"state": "on",
"attributes": {
"id": "1686833960430",
"last_triggered": "2023-08-29T06:14:10.728292+00:00",
"mode": "parallel",
"current": 0,
"max": 10,
"friendly_name": "Telegram - Mensaje Backups"
},
"last_changed": "2023-08-29T06:11:49.938289+00:00",
"last_updated": "2023-08-29T06:14:10.758414+00:00",
"context": {
"id": "01H8ZYV6H7XPEDN5ME9HJAW0DT",
"parent_id": "01H8ZYV6H3KVG8CYC3W5RH67CD",
"user_id": null
}
},
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "state",
"entity_id": "var.estado_backup_local",
"from_state": {
"entity_id": "var.estado_backup_local",
"state": "En proceso",
"attributes": {
"event_name": "BEFORE",
"result_file": "",
"datetime": "2023-08-29T06:14:10.707057241+00:00",
"icon": "mdi:cloud-upload",
"friendly_name": "Estado Backup Local"
},
"last_changed": "2023-08-29T06:14:10.725097+00:00",
"last_updated": "2023-08-29T06:14:10.725097+00:00",
"context": {
"id": "01H8ZYV6H3KVG8CYC3W5RH67CD",
"parent_id": null,
"user_id": "1d9d4eaa60a24966aa8732687ec608e2"
}
},
"to_state": {
"entity_id": "var.estado_backup_local",
"state": "Success",
"attributes": {
"event_name": "AFTER",
"result_file": "/tmp/dup-bee3f0f1-e151-4be3-ad96-b66c9a6e1488",
"datetime": "2023-08-29T06:14:19.720219254+00:00",
"icon": "mdi:cloud-upload",
"friendly_name": "Estado Backup Local"
},
"last_changed": "2023-08-29T06:14:19.736486+00:00",
"last_updated": "2023-08-29T06:14:19.736486+00:00",
"context": {
"id": "01H8ZYVFAPGXRH9Z56S851QQR6",
"parent_id": null,
"user_id": "1d9d4eaa60a24966aa8732687ec608e2"
}
},
"for": null,
"attribute": null,
"description": "state of var.estado_backup_local"
}
}
}
],
"condition/0": [
{
"path": "condition/0",
"timestamp": "2023-08-29T06:14:19.739768+00:00",
"result": {
"result": true,
"entities": []
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2023-08-29T06:14:19.744284+00:00",
"changed_variables": {
"context": {
"id": "01H8ZYVFAV3DZCZPPZBSEPNY2P",
"parent_id": "01H8ZYVFAPGXRH9Z56S851QQR6",
"user_id": null
}
},
"result": {
"params": {
"domain": "notify",
"service": "telegram",
"service_data": {
"message": "💾 Estado Backup Local - Success"
},
"target": {}
},
"running_script": false
}
}
],
"action/1": [
{
"path": "action/1",
"timestamp": "2023-08-29T06:14:19.766827+00:00"
}
],
"action/1/if": [
{
"path": "action/1/if",
"timestamp": "2023-08-29T06:14:19.766956+00:00",
"result": {
"result": false
}
}
],
"action/1/if/condition/0": [
{
"path": "action/1/if/condition/0",
"timestamp": "2023-08-29T06:14:19.767008+00:00",
"result": {
"result": false,
"entities": []
}
}
]
},
"config": {
"id": "1686833960430",
"alias": "Telegram - Mensaje Backups",
"description": "",
"trigger": [
{
"platform": "state",
"entity_id": [
"var.estado_backup_docker",
"var.estado_backup_mayoral",
"var.estado_backup_local",
"var.estado_backup_rpi"
]
}
],
"condition": [
{
"condition": "template",
"value_template": "{{ trigger.from_state.state != trigger.to_state.state }}"
}
],
"action": [
{
"service": "notify.telegram",
"data": {
"message": "💾 {{ trigger.to_state.name }} - {{ trigger.to_state.state }}"
}
},
{
"if": [
{
"condition": "template",
"value_template": "{{ trigger.to_state.state != 'Success' }}"
}
],
"then": [
{
"service": "notify.persistent_notification",
"data": {
"message": "Backup fallido.",
"title": "ATENCIÓN"
}
}
]
}
],
"mode": "parallel",
"max": 10
},
"blueprint_inputs": null,
"context": {
"id": "01H8ZYVFAV3DZCZPPZBSEPNY2P",
"parent_id": "01H8ZYVFAPGXRH9Z56S851QQR6",
"user_id": null
}
},
"logbookEntries": []
}