i have been trying this automation for my outdoor light with mixed success
it seems to work
but sometimes my light is turning on in the evening but then immediately turning off
the automation trace shows this, any tips?
{
"trace": {
"last_step": "action/0/choose/0/sequence/0",
"run_id": "5c99200b1df3c7a3e3131521817557c1",
"state": "stopped",
"script_execution": "finished",
"timestamp": {
"start": "2022-01-14T15:18:51.891498+00:00",
"finish": "2022-01-14T15:18:51.926061+00:00"
},
"domain": "automation",
"item_id": "1641316866498",
"trigger": "sunset with offset",
"trace": {
"trigger/0": [
{
"path": "trigger/0",
"timestamp": "2022-01-14T15:18:51.891874+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.front_door_sun_sunset",
"state": "on",
"attributes": {
"last_triggered": "2022-01-14T05:59:21.150697+00:00",
"mode": "single",
"current": 0,
"id": "1641316866498",
"friendly_name": "Front Door Sunset/Sunrise"
},
"last_changed": "2022-01-13T19:21:58.168131+00:00",
"last_updated": "2022-01-14T05:59:21.179685+00:00",
"context": {
"id": "55e514f33ca596cb95bb58b986d3d2f2",
"parent_id": null,
"user_id": null
}
},
"trigger": {
"id": "sunset",
"idx": "0",
"platform": "sun",
"event": "sunset",
"offset": {
"__type": "<class 'datetime.timedelta'>",
"total_seconds": -3600
},
"description": "sunset with offset"
}
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2022-01-14T15:18:51.894671+00:00",
"changed_variables": {
"context": {
"id": "23cbe8d5c99d7f26fc9dd30110223fef",
"parent_id": null,
"user_id": null
}
},
"result": {
"choice": 0
}
}
],
"action/0/choose/0": [
{
"path": "action/0/choose/0",
"timestamp": "2022-01-14T15:18:51.895084+00:00",
"result": {
"result": true
}
}
],
"action/0/choose/0/conditions/0": [
{
"path": "action/0/choose/0/conditions/0",
"timestamp": "2022-01-14T15:18:51.895309+00:00",
"result": {
"result": true
}
}
],
"action/0/choose/0/sequence/0": [
{
"path": "action/0/choose/0/sequence/0",
"timestamp": "2022-01-14T15:18:51.901569+00:00"
}
]
},
"config": {
"id": "1641316866498",
"alias": "Front Door Sunset/Sunrise",
"description": "",
"trigger": [
{
"platform": "sun",
"event": "sunset",
"id": "sunset",
"offset": "-01:00"
},
{
"platform": "time",
"at": "23:30",
"id": "dim"
},
{
"platform": "sun",
"event": "sunrise",
"offset": "-02:00",
"id": "sunrise"
}
],
"condition": [],
"action": [
{
"choose": [
{
"conditions": [
{
"condition": "trigger",
"id": "sunset"
}
],
"sequence": [
{
"type": "turn_on",
"device_id": "03419912808df6849d866075b5de8421",
"entity_id": "light.outdoor_front",
"domain": "light",
"brightness_pct": 100
}
]
},
{
"conditions": [
{
"condition": "trigger",
"id": "dim"
}
],
"sequence": [
{
"type": "turn_on",
"device_id": "03419912808df6849d866075b5de8421",
"entity_id": "light.outdoor_front",
"domain": "light",
"brightness_pct": 30
}
]
},
{
"conditions": [
{
"condition": "trigger",
"id": "sunrise"
}
],
"sequence": [
{
"type": "turn_off",
"device_id": "03419912808df6849d866075b5de8421",
"entity_id": "light.outdoor_front",
"domain": "light"
}
]
}
],
"default": []
}
]
},
"blueprint_inputs": null,
"context": {
"id": "23cbe8d5c99d7f26fc9dd30110223fef",
"parent_id": null,
"user_id": null
}
},
"logbookEntries": [
{
"name": "Front Door Sunset/Sunrise",
"message": "has been triggered by sunset with offset",
"source": "sunset with offset",
"entity_id": "automation.front_door_sun_sunset",
"context_id": "23cbe8d5c99d7f26fc9dd30110223fef",
"when": "2022-01-14T15:18:51.892378+00:00",
"domain": "automation"
},
{
"when": "2022-01-14T15:18:51.918495+00:00",
"name": "Outdoor Front",
"state": "on",
"entity_id": "light.outdoor_front",
"context_entity_id": "automation.front_door_sun_sunset",
"context_entity_id_name": "Front Door Sunset/Sunrise",
"context_event_type": "automation_triggered",
"context_domain": "automation",
"context_name": "Front Door Sunset/Sunrise",
"message": "turned on"
},
{
"when": "2022-01-14T15:18:51.948669+00:00",
"name": "Outdoor Front",
"state": "off",
"entity_id": "light.outdoor_front",
"context_entity_id": "automation.front_door_sun_sunset",
"context_entity_id_name": "Front Door Sunset/Sunrise",
"context_event_type": "automation_triggered",
"context_domain": "automation",
"context_name": "Front Door Sunset/Sunrise",
"message": "turned off"
}
]
}
Triggered by the sunset with offset at 14 January 2022, 15:18:51
Choose: Option 1 executed
Outdoor Front (light.outdoor_front) turned on
Outdoor Front (light.outdoor_front) turned off
Finished at 14 January 2022, 15:18:51 (runtime: 0.04 seconds)