The time part did work! The jalouzie opened correctly.
But the sunset part, it seems that it was triggered, but the jalouzie did not close…
This is the Trace:
{
"trace": {
"last_step": "action/0",
"run_id": "41de510d25ad495ab2a37f5ea1093f7b",
"state": "stopped",
"script_execution": "finished",
"timestamp": {
"start": "2022-09-24T17:33:24.956492+00:00",
"finish": "2022-09-24T17:33:25.029004+00:00"
},
"domain": "automation",
"item_id": "1663960932662",
"trigger": "sunset",
"trace": {
"trigger/1": [
{
"path": "trigger/1",
"timestamp": "2022-09-24T17:33:24.956676+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.20_example_badkamer_jalouzie",
"state": "on",
"attributes": {
"last_triggered": "2022-09-24T13:41:40.048672+00:00",
"mode": "single",
"current": 0,
"id": "1663960932662",
"friendly_name": "02 - Badkamer jalouzie Open Sluit - (versie 123 Taras)"
},
"last_changed": "2022-09-24T17:01:19.843961+00:00",
"last_updated": "2022-09-24T17:01:19.843961+00:00",
"context": {
"id": "01GDR74GK3WKESH802MJ1108J1",
"parent_id": null,
"user_id": null
}
},
"trigger": {
"id": "1",
"idx": "1",
"alias": null,
"platform": "sun",
"event": "sunset",
"offset": {
"__type": "<class 'datetime.timedelta'>",
"total_seconds": 0
},
"description": "sunset"
}
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2022-09-24T17:33:24.972957+00:00",
"changed_variables": {
"context": {
"id": "01GDR8Z8JWR90FXDWTM4GJ3GNV",
"parent_id": null,
"user_id": null
}
},
"result": {
"params": {
"domain": "cover",
"service": "set_cover_position",
"service_data": {
"position": 0,
"entity_id": [
"cover.badkamer_jalouzie"
]
},
"target": {
"entity_id": [
"cover.badkamer_jalouzie"
]
}
},
"running_script": false,
"limit": 10
}
}
]
},
"config": {
"id": "1663960932662",
"alias": "02 - Badkamer jalouzie Open Sluit - (versie 123 Taras)",
"description": "Openen en sluiten badkamer jalouzie (07:40 en Sunset)",
"trigger": [
{
"platform": "time",
"at": "07:40:00"
},
{
"platform": "sun",
"event": "sunset",
"offset": "-00:00:00"
}
],
"condition": [],
"action": [
{
"service": "cover.set_cover_position",
"target": {
"entity_id": "cover.badkamer_jalouzie"
},
"data": {
"position": "{{ iif(trigger.platform == 'time', 100, 0) }}"
}
}
],
"mode": "single"
},
"blueprint_inputs": null,
"context": {
"id": "01GDR8Z8JWR90FXDWTM4GJ3GNV",
"parent_id": null,
"user_id": null
}
},
"logbookEntries": [
{
"name": "02 - Badkamer jalouzie Open Sluit - (versie 123 Taras)",
"message": "triggered by sunset",
"source": "sunset",
"entity_id": "automation.20_example_badkamer_jalouzie",
"context_id": "01GDR8Z8JWR90FXDWTM4GJ3GNV",
"when": 1664040804.957065,
"domain": "automation"
},
{
"when": 1664040806.461513,
"state": "closing",
"entity_id": "cover.badkamer_jalouzie",
"icon": "mdi:blinds-vertical-closed",
"context_event_type": "automation_triggered",
"context_domain": "automation",
"context_name": "02 - Badkamer jalouzie Open Sluit - (versie 123 Taras)",
"context_message": "triggered by sunset",
"context_source": "sunset",
"context_entity_id": "automation.20_example_badkamer_jalouzie"
}
]
}
It is an Aqara Zigbee device that works perfectly from the dashboard or a Zigbee battery powered switch. If i interpret the trace correctly, than the sunset is triggered.
I noticed however one other strange thing in the Trace. It has at line 20 this entity:
"entity_id": "automation.20_example_badkamer_jalouzie",
And the example is a left over from the default configuration of creating an automation…
But that is not what is in the Automation:
alias: 02 - Badkamer jalouzie Open Sluit - (versie 123 Taras)
description: Openen en sluiten badkamer jalouzie (07:40 en Sunset)
trigger:
- platform: time
at: "07:40:00"
- platform: sun
event: sunset
offset: "-00:00:00"
condition: []
action:
- service: cover.set_cover_position
target:
entity_id: cover.badkamer_jalouzie
data:
position: "{{ iif(trigger.platform == 'time', 100, 0) }}"
mode: single