struct EnergyEvseTrait
This trait is for devices that provide electric vehicle supply equipment (EVSE) functionality.
-
List of the event types that are supported by
EnergyEvseTrait
.Declaration
Swift
static let supportedEventTypes: [any Event.Type]
-
List of the commands that are supported by
EnergyEvseTrait
.Declaration
Swift
static let supportedCommandTypes: [any Command.Type]
-
The trait identifier.
Declaration
Swift
static let identifier: String
-
Metadata about this
Trait
.Declaration
Swift
let metadata: TraitMetadata
-
List of attributes for the
EnergyEvseTrait
.Declaration
Swift
let attributes: Matter.EnergyEvseTrait.Attributes
-
Creates a new Trait instance using data read from the given
TraitDecoder
.Throws
HomeError.parseError
when parsing fails.Declaration
Swift
init(decoder: TraitDecoder, interactionProxy: (any InteractionProxy)?, metadata: TraitMetadata) throws
Parameters
decoder
The raw data representing this Trait.
interactionProxy
Proxy to the Interaction Client.
metadata
Metadata about this Trait.
-
Writes this object to the given
TraitEncoder
. ThrowsHomeError.encodingFailed
if the data could not be encoded.Declaration
Swift
func encode(with encoder: TraitEncoder) throws
-
This API provides the ability to invalidate state retrieved through subscriptions to the target device in the cases where state is not being reported correctly, either intentionally (e.g attributes in Matter traits with the “C” quality) or unintentionally due to poor implementations.
When successful, this API will result in a forced read of the convening scope as specified by the sub-class and return the result through existing Trait subscriptions if present and active.
This API is to be used sparingly as it can impact the performance and battery life of the target device. As such, this API may be throttled by the platform. Callers SHALL be prepared to deal with
HomeError
s thrown by this call.Declaration
Swift
func forceRead() async throws
-
Attributes for the
EnergyEvseTrait
.Declaration
Swift
struct Attributes
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
a
andb
,a == b
implies thata != b
isfalse
.Parameters
lhs
A value to compare.
rhs
Another value to compare.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashable
protocol. The components used for hashing must be the same as the components compared in your type’s==
operator implementation. Callhasher.combine(_:)
with each of these components.Important
In your implementation of
hash(into:)
, don’t callfinalize()
on thehasher
instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.Declaration
Swift
func hash(into hasher: inout Hasher)
-
A single user-specified charging target for an electric vehicle.
Declaration
Swift
struct ChargingTargetStruct
-
A set of user-specified charging targets for an electric vehicle for a set of specified days.
Declaration
Swift
struct ChargingTargetScheduleStruct
-
Notification that the electric vehicle has connected to the EVSE.
Declaration
Swift
struct EVConnectedEvent
-
Notification that the electric vehicle has been removed from the EVSE.
Declaration
Swift
struct EVNotDetectedEvent
-
Notification that the electric vehicle has started charging or discharging.
Declaration
Swift
struct EnergyTransferStartedEvent
-
Notification that the electric vehicle has stopped charging or discharging.
Declaration
Swift
struct EnergyTransferStoppedEvent
-
Notification of a fault in the EVSE. The
supplyState
attribute gets set toDisabledError
and the type of fault detected by the EVSE is stored in thefaultState
attribute.Declaration
Swift
struct FaultEvent
-
Notification that a radio frequency identification card (RFID) has been read. This allows a controller to register the card ID and use the ID to authenticate the user and start the charging session.
Declaration
Swift
struct RfidEvent
-
Whether the device supports the
disable
command for this trait.Declaration
Swift
var supportsDisableCommand: Bool { get }
-
Disables the EVSE from charging and discharging.
Declaration
Swift
func disable() async throws
-
The batchable version of disable command above.
See also
disableDeclaration
Swift
func disableBatchable() throws -> BatchableCommand<Void>
-
Whether the device supports the
enableCharging
command for this trait.Declaration
Swift
var supportsEnableChargingCommand: Bool { get }
-
Enables the EVSE to charge an electric vehicle.
Declaration
Swift
func enableCharging(chargingEnabledUntil: UInt32?, minimumChargeCurrent: Int64, maximumChargeCurrent: Int64) async throws
Parameters
chargingEnabledUntil
The time, in UTC, when charging becomes disabled. If the value is in the past, charging is disabled. If the value is null, charging is permanently enabled.
minimumChargeCurrent
The minimum current, in milliamps, that the EVSE can deliver to the electric vehicle.
maximumChargeCurrent
The maximum current, in milliamps, that the EVSE can deliver to the electric vehicle.
-
The batchable version of enableCharging command above.
See also
enableChargingDeclaration
Swift
func enableChargingBatchable(chargingEnabledUntil: UInt32?, minimumChargeCurrent: Int64, maximumChargeCurrent: Int64) throws -> BatchableCommand<Void>
-
Whether the device supports the
enableDischarging
command for this trait.Declaration
Swift
var supportsEnableDischargingCommand: Bool { get }
-
Enables the EVSE to discharge an electric vehicle.
Declaration
Swift
func enableDischarging(dischargingEnabledUntil: UInt32?, maximumDischargeCurrent: Int64) async throws
Parameters
dischargingEnabledUntil
The time, in UTC, when discharging becomes disabled. If the value is in the past, discharging is disabled. If the value is null, discharging is permanently enabled.
maximumDischargeCurrent
The maximum current, in milliamps, that the EVSE can receive from the electric vehicle.
-
The batchable version of enableDischarging command above.
See also
enableDischargingDeclaration
Swift
func enableDischargingBatchable(dischargingEnabledUntil: UInt32?, maximumDischargeCurrent: Int64) throws -> BatchableCommand<Void>
-
Whether the device supports the
startDiagnostics
command for this trait.Declaration
Swift
var supportsStartDiagnosticsCommand: Bool { get }
-
Puts the EVSE into self-diagnostics mode as long as the
supplyState
attribute is in theDisabled
state when the command is sent.Declaration
Swift
func startDiagnostics() async throws
-
The batchable version of startDiagnostics command above.
See also
startDiagnosticsDeclaration
Swift
func startDiagnosticsBatchable() throws -> BatchableCommand<Void>
-
Whether the device supports the
setTargets
command for this trait.Declaration
Swift
var supportsSetTargetsCommand: Bool { get }
-
Allows a client to set user-specified charging targets.
Declaration
Swift
func setTargets(chargingTargetSchedules: [Matter.EnergyEvseTrait.ChargingTargetScheduleStruct]) async throws
Parameters
chargingTargetSchedules
A list of up to seven sets of daily charging targets and their associated days of the week. Each day of the week can be included in only a single
chargingTargetSchedule
in this field. -
The batchable version of setTargets command above.
See also
setTargetsDeclaration
Swift
func setTargetsBatchable(chargingTargetSchedules: [Matter.EnergyEvseTrait.ChargingTargetScheduleStruct]) throws -> BatchableCommand<Void>
-
Whether the device supports the
getTargets
command for this trait.Declaration
Swift
var supportsGetTargetsCommand: Bool { get }
-
Allows a client to retrieve the current set of charging targets.
Declaration
Swift
func getTargets() async throws -> Matter.EnergyEvseTrait.GetTargetsCommandResponse
Return Value
The result of the
GetTargets
command. -
The batchable version of getTargets command above.
See also
getTargetsDeclaration
Swift
func getTargetsBatchable() throws -> BatchableCommand<Matter.EnergyEvseTrait.GetTargetsCommandResponse>
-
Whether the device supports the
clearTargets
command for this trait.Declaration
Swift
var supportsClearTargetsCommand: Bool { get }
-
Allows a client to clear all stored charging targets.
Declaration
Swift
func clearTargets() async throws
-
The batchable version of clearTargets command above.
See also
clearTargetsDeclaration
Swift
func clearTargetsBatchable() throws -> BatchableCommand<Void>
-
The reason for stopping the energy transfer.
Declaration
Swift
enum EnergyTransferStoppedReasonEnum
-
The fault state of the EVSE.
Declaration
Swift
enum FaultStateEnum
-
The state of the electric vehicle.
Declaration
Swift
enum StateEnum
-
Whether the electric vehicle is allowed to charge or disharge.
Declaration
Swift
enum SupplyStateEnum
-
EnergyEvse cluster FeatureMap.
Declaration
Swift
struct Feature
-
The day of the week.
Declaration
Swift
struct TargetDayOfWeekBitmap