A Special Event defines an exception that overrides the normal weekly schedule on selected days. It is the mechanism Schedule objects use for holidays, maintenance windows, after-hours operation, etc.
It contains:
period: aBACnet.Protocol.CalendarEntry(date / date range / week-n-day) or aBACnet.Protocol.ObjectIdentifierreferencing a Calendar object whosedate_listsupplies the days.list: the replacementBACnet.Protocol.DailySchedule(list ofBACnet.Protocol.TimeValue) to use on those days.priority: 1-16 (lowest number wins on overlap).
BACnet Specification References
- ASN.1 (Clause 21):
BACnetSpecialEvent ::= SEQUENCE { period CHOICE { calendarEntry [0] BACnetCalendarEntry, calendarReference [1] BACnetObjectIdentifier }, listOfTimeValues [2] SEQUENCE OF BACnetTimeValue, eventPriority [3] Unsigned (1..16) } - Schedule object (12.24):
exception_scheduleis a list of these. The priority field resolves conflicts when multiple special events match the same day (lower number = higher precedence).
Examples
Special event using a CalendarEntry
iex> event = %SpecialEvent{
...> period: %CalendarEntry{
...> type: :date,
...> date: %BACnetDate{year: 2025, month: 12, day: 25, weekday: 4},
...> date_range: nil,
...> week_n_day: nil
...> },
...> list: [
...> %TimeValue{time: %BACnetTime{hour: 0, minute: 0, second: 0, hundredth: 0}, value: {:null, nil}},
...> %TimeValue{time: %BACnetTime{hour: 8, minute: 0, second: 0, hundredth: 0}, value: {:real, 22.0}}
...> ],
...> priority: 5
...> }
iex> event.priority
5Special event referencing another Calendar object
iex> event = %SpecialEvent{
...> period: %ObjectIdentifier{type: :calendar, instance: 1},
...> list: [], # replacement DailySchedule as list of TimeValue
...> priority: 3
...> }
iex> event.priority
3See Also
Summary
Types
Exception schedule entry: period (BACnet.Protocol.CalendarEntry or Calendar object ref) +
replacement BACnet.Protocol.DailySchedule + priority 1..16.
Functions
Encode a BACnet special event into application tag-encoded.
Parse a BACnet special event from application tags encoding.
Validates whether the given special event is in form valid.
Types
@type t() :: %BACnet.Protocol.SpecialEvent{ list: [BACnet.Protocol.TimeValue.t()], period: BACnet.Protocol.CalendarEntry.t() | BACnet.Protocol.ObjectIdentifier.t(), priority: 1..16 }
Exception schedule entry: period (BACnet.Protocol.CalendarEntry or Calendar object ref) +
replacement BACnet.Protocol.DailySchedule + priority 1..16.
Functions
@spec encode(t(), Keyword.t()) :: {:ok, BACnet.Protocol.ApplicationTags.encoding_list()} | {:error, term()}
Encode a BACnet special event into application tag-encoded.
@spec parse(BACnet.Protocol.ApplicationTags.encoding_list()) :: {:ok, {t(), rest :: BACnet.Protocol.ApplicationTags.encoding_list()}} | {:error, term()}
Parse a BACnet special event from application tags encoding.
Validates whether the given special event is in form valid.
It only validates the struct is valid as per type specification.