diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts index 51717108c2..7d205322cd 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts @@ -106,7 +106,9 @@ export class HaCalendarTrigger extends LitElement implements TriggerElement { const offsetType = ev.detail.value.offset_type === "before" ? "-" : ""; const newTrigger = { ...ev.detail.value, - offset: `${offsetType}${duration.hours}:${duration.minutes}:${duration.seconds}`, + offset: `${offsetType}${duration.hours ?? 0}:${duration.minutes ?? 0}:${ + duration.seconds ?? 0 + }`, }; delete newTrigger.offset_type; fireEvent(this, "value-changed", { value: newTrigger });