Hi, I am a noobie when it comes to HA and still learning the ropes. That said, I have added all of my sensors and done a fair bit of automation already but am really struggling with this one. Searches for similar automation have come up short so looking for help here.
Here is what I wish to do
Around sunrise (maybe 30 mins before to an hour after) and if my sensor shows the light is above a certain lux level, I want to open my blinds. Since the illuminance value will not happen at a fixed time, I wanted a 2 hour window around sunrise.
Similarly, I want to do the same around sunset. When the lux drops below a number, I want it to close.
Here is the automation code
alias: open blinds around sunrise
description: ""
trigger:
- type: illuminance
platform: device
device_id: 166c72c5466b7ead2fa823675848ab00
entity_id: 493b529fe48dda774014ef5c86af45f8
domain: sensor
above: 450
condition:
- condition: sun
before: sunrise
before_offset: "-00:30"
after: sunrise
after_offset: "+01:30"
action:
- device_id: a107c63329961c0649e1d13ad2003df7
domain: cover
entity_id: 43874310c9592bb07ad623b2ee7b009c
type: open
- device_id: e06dffb21b30dc2659d169eefba503ca
domain: cover
entity_id: 50d4766d3402c82b82b01f7f92caee59
type: open
mode: single
Here is the trace
{
"trace": {
"last_step": "condition/0",
"run_id": "afb1b804695e88ff42f51b9801fa01a6",
"state": "stopped",
"script_execution": "failed_conditions",
"timestamp": {
"start": "2024-01-10T17:42:00.677285+00:00",
"finish": "2024-01-10T17:42:00.677839+00:00"
},
"domain": "automation",
"item_id": "1704868212751",
"trigger": "numeric state of sensor.eve_motion_illuminance_illuminance",
"trace": {
"trigger/0": [
{
"path": "trigger/0",
"timestamp": "2024-01-10T17:42:00.677348+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.open_blinds_around_sunrise",
"state": "on",
"attributes": {
"id": "1704868212751",
"last_triggered": null,
"mode": "single",
"current": 0,
"friendly_name": "open blinds around sunrise"
},
"last_changed": "2024-01-10T11:50:57.108957+00:00",
"last_updated": "2024-01-10T11:50:57.108957+00:00",
"context": {
"id": "01HKSKC5AMHR4XWBGSMY7HWRDS",
"parent_id": null,
"user_id": null
}
},
"trigger": {
"id": "0",
"idx": "0",
"alias": null,
"platform": "device",
"entity_id": "sensor.eve_motion_illuminance_illuminance",
"below": null,
"above": 450,
"from_state": {
"entity_id": "sensor.eve_motion_illuminance_illuminance",
"state": "432.7",
"attributes": {
"state_class": "measurement",
"unit_of_measurement": "lx",
"device_class": "illuminance",
"friendly_name": "Eve motion/illuminance Illuminance"
},
"last_changed": "2024-01-10T17:35:30.698995+00:00",
"last_updated": "2024-01-10T17:35:30.698995+00:00",
"context": {
"id": "01HKT732CAR1YEYP1KC9E9ZTFX",
"parent_id": null,
"user_id": null
}
},
"to_state": {
"entity_id": "sensor.eve_motion_illuminance_illuminance",
"state": "503.7",
"attributes": {
"state_class": "measurement",
"unit_of_measurement": "lx",
"device_class": "illuminance",
"friendly_name": "Eve motion/illuminance Illuminance"
},
"last_changed": "2024-01-10T17:42:00.676847+00:00",
"last_updated": "2024-01-10T17:42:00.676847+00:00",
"context": {
"id": "01HKT7EZ74FRD0ZTEM7FPVZMPG",
"parent_id": null,
"user_id": null
}
},
"for": null,
"description": "numeric state of sensor.eve_motion_illuminance_illuminance"
}
}
}
],
"condition/0": [
{
"path": "condition/0",
"timestamp": "2024-01-10T17:42:00.677402+00:00",
"result": {
"wanted_time_before": "2024-01-10T14:53:18.735798+00:00",
"result": false
}
}
]
},
"config": {
"id": "1704868212751",
"alias": "open blinds around sunrise",
"description": "",
"trigger": [
{
"type": "illuminance",
"platform": "device",
"device_id": "166c72c5466b7ead2fa823675848ab00",
"entity_id": "493b529fe48dda774014ef5c86af45f8",
"domain": "sensor",
"above": 450
}
],
"condition": [
{
"condition": "sun",
"before": "sunrise",
"before_offset": "-00:30",
"after": "sunrise",
"after_offset": "+01:30"
}
],
"action": [
{
"device_id": "a107c63329961c0649e1d13ad2003df7",
"domain": "cover",
"entity_id": "43874310c9592bb07ad623b2ee7b009c",
"type": "open"
},
{
"device_id": "e06dffb21b30dc2659d169eefba503ca",
"domain": "cover",
"entity_id": "50d4766d3402c82b82b01f7f92caee59",
"type": "open"
}
],
"mode": "single"
},
"blueprint_inputs": null,
"context": {
"id": "01HKT7EZ75MFACNV8RP7PDPB4Q",
"parent_id": "01HKT7EZ74FRD0ZTEM7FPVZMPG",
"user_id": null
}
},
"logbookEntries": []
}
Can someone help me figure out what I am doing wrong. Thanks much for your help