My current attempt:
alias: Holiday_Lights-Halloween
description: ""
trigger:
- platform: calendar
entity_id: calendar.halloween_holiday
condition:
- condition: sun
after: sunset
after_offset: "-00:45:00"
enabled: false
action:
- if:
- condition: state
entity_id: calendar.halloween_holiday
state: "on"
then:
- device_id: <wled_holiday_lights_device_UUID>
domain: select
entity_id: <wled_holiday_lights_entity_UUID>
type: select_option
option: "{{['Halloween_1','Halloween_2','Halloween_3','Halloween_4']|random}}"
mode: single
I am getting this error:
Error: Option {{[‘Halloween_1’,‘Halloween_2’,‘Halloween_3’,‘Halloween_4’]|random}} is not valid for entity select.wled_holiday_lights_preset, valid options are: …, Halloween_1, Halloween_2, Halloween_3, Halloween_4, …
I have tried a few different approaches this this. For example, tried variables as demoed in this thread: https://community.home-assistant.io/t/random-choice-in-automations-and-scripts/705783/11
This thread asks the same question, but about a different outcome: https://community.home-assistant.io/t/can-an-automation-randomly-select-from-a-list-during-action/315718/2
Interestingly, this post asks a very similar question in the last post, but with no answer: https://community.home-assistant.io/t/wled-and-presets-select/326901
This post on Reddit was almost exactly what I was trying to accomplish:
https://www.reddit.com/r/homeassistant/comments/17d1d0g/randomized_automation_action_data_help/
Their solution is the one I have left in my code, since it seems to be the closest to the solution, but it is resulting in the above error.
If I just do
option: Halloween_1
The automation works fine.