A single Time Trigger also permits multiple times like this:
- trigger:
- platform: time
at:
- "15:32:00"
- "17:50:00"
Here is its format in JSON. It presents the value of at
as a list of time strings.
[
{
"trigger": [
{
"platform": "time",
"at": [
"15:32:00",
"17:50:00"
]
}
]
}
]
To suppost multiple times within a single Time Trigger, your suggestion would need to be constructed like this:
- trigger:
- platform: time
at:
- time: "15:32:00"
day: "mon"
- time: "17:50:00"
day:
- "fri"
- "sat"
The JSON equivalent is a list where each item is a dict containing two keys:
[
{
"trigger": [
{
"platform": "time",
"at": [
{
"time": "15:32:00",
"day": "mon"
},
{
"time": "17:50:00",
"day": [
"fri",
"sat"
]
}
]
}
]
}
]
Home Assistant must inspect at
and check if its value contains one of the following:
- a single time string
- a list of time strings
- a list of dicts where each item in the dict contains
time
and day
keys
It’s all feasible but might require an Architectural review because the inclusion of a weekday alters the Time Trigger’s scope (which has been traditionally constrained to “time of day”).
Time Trigger also supports an input_datetime
so it would also be possible to do this:
- trigger:
- platform: time
at:
- time: "15:32:00"
day: "mon"
- time: input_datetime.whatever
day:
- "fri"
- "sat"
That means yet more processing of the time
key to determine if it contains a time string or an entity_id.
It’s a useful enhancement but it remains to be seen if attracts the attention of any developers.