The first learn how to do an automation to fire a saved preset.
Next. You need to have something for your calendar (I use the Google calendar integration but you an use any calendar)
Next your trigger. Sounds like a time based trigger (your dusk event)
At that point read the state of your sensor containing the calendar data and then react use it to fire the appropriate light. Turn_on service call… Shouldnt be too hard. Start with working on just triggering on dusk when the calendar is present then move on to firing the RIGHT wled program.
Ok here is my automation that just ran a little while ago
alias: Sunset White LED
description: ""
triggers:
- event: sunset
offset: "-00:30:00"
trigger: sun
conditions:
- condition: or
conditions:
- condition: device
type: is_off
device_id: 5282a89293d51c1039bcd62f54475336
entity_id: e8e4a187dc8fad5f94fd1f6dbc508581
domain: light
- condition: device
device_id: 5282a89293d51c1039bcd62f54475336
domain: select
entity_id: ad0614ac4390e6afabfbf80a8c9348a1
type: selected_option
option: "Off"
actions:
- device_id: 5282a89293d51c1039bcd62f54475336
domain: select
entity_id: ad0614ac4390e6afabfbf80a8c9348a1
type: select_option
option: White
mode: single
My plan will be a separate automation that will run ahead of this, so next need to be able to read if there is an entry with today’s date, then pass that description as the option to fire
the calendar integrations generally report a binary sensor if the calendar item matching pattern X is on. So you can use this to your advantage.
You could have different calendar entries that turn on and off the entries like a light switch. Youd just have to handle conflicts in scheduling gracefully.
Here’s more info on how calendar entities work: Calendar - Home Assistant (note the light schedule sample)
Thanks Art, but that is my issue, I confirm hardcoding a preset name causes it to run correctly. The problem I’m looking to automate and use the data found on the calendar, which I already check to confirm that the day is correct to run these lights
So are you pulling the name of the preset from the calendar? That doesn’t seem like the most efficient way to go about it. I use WLED and control all my lighting using automations and scripts to select the correct preset at the correct time/date. This allows my lighting to work regardless of Google Calendar/Internet connections or other access issues.
For example, here is the Halloween automation and script:
Yes, I have about 12 or 13 automations/scripts that cover all the holidays we have custom lighting defined for in WLED. If it is not a holiday, then I revert to a seasonal color preset. I also calculate the NEXT occurrence of the particular holiday once the current holiday ends, so… NO manual config necessary, EVER. If I change a color scheme in WLED, I simply update the preset name in my dashboard. See pics
Automations manage the entire process, from setting the correct season or holiday to populating the correct preset to WLED. Yes, it may seem like a lot of coding, but it is 100% self sufficient and I don’t need to touch it at all (unless I change/add a color scheme).
I use input booleans as the on/off for a holiday and a select and input_select for the preset. The first comes from WLED and the second is populated in manually (once). Look at the first pic Holiday Colors box. It’s the last two items. All my lighting can then be pushed to a mini grid where it is easy to see when things will occur.
My Presets:
Wow nicely done… I’m far from that level, but that’s the great part about programming, there are many ways to get to the same point.
I commend you on what you’ve accomplished here, I think once figure out what in trying to do will be easier than starting over, but need to work on looking into scripting sooner than later.