> Documentation index: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/llms.txt

    struct EnergyScenarioAnalysisTrait

Stores and evaluates monthly energy savings simulations.
- `


  ### [identifier](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV10identifierSSvpZ)


  ` The trait identifier.

  #### Declaration

  Swift

      static let identifier: String

- `


  ### [supportedEventTypes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV014supportedEventC0Say0aB3SDK0I0_pXpGvpZ)


  ` List of all event types on the given Trait.

  Currently, only `MatterTrait` traits support any events, but this will likely expand to other
  traits in the future.

  #### Declaration

  Swift

      static let supportedEventTypes: [any Event.Type]

- `


  ### [supportedCommandTypes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV016supportedCommandC0Say0aB3SDK0I0_pXpGvpZ)


  ` List of all commands supported by the Trait's definition. The commands supported by a specific
  Trait instance may vary.

  #### Declaration

  Swift

      static var supportedCommandTypes: [any Command.Type] { get }

- `


  ### [metadata](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV8metadata0aB3SDK0G8MetadataVvp)


  ` Metadata about this `Trait`.

  #### Declaration

  Swift

      let metadata: TraitMetadata

- `


  ### [init(decoder:interactionProxy:metadata:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV7decoder16interactionProxy8metadataAE0aB3SDK0G7DecoderV_AI011InteractionJ0_pSgAI0G8MetadataVtKcfc)


  ` 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. |

- `


  ### [encode(with:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV6encode4withy0aB3SDK0G7EncoderC_tKF)


  ` Writes this object to the given `TraitEncoder`.
  Throws `HomeError.encodingFailed` if the data could not be encoded.

  #### Declaration

  Swift

      func encode(with encoder: TraitEncoder) throws

- `


  ### [==(_:_:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV2eeoiySbAE_AEtFZ)


  ` Returns a Boolean value indicating whether two values are equal.

  Equality is the inverse of inequality. For any values `a` and `b`,
  `a == b` implies that `a != b` is `false`.

  #### Declaration

  Swift

      static func == (lhs: Google.EnergyScenarioAnalysisTrait, rhs: Google.EnergyScenarioAnalysisTrait) -> Bool

  #### Parameters

  |---|---|
  | ` lhs ` | A value to compare. |
  | ` rhs ` | Another value to compare. |

- `


  ### [hash(into:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV4hash4intoys6HasherVz_tF)


  ` 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. Call `hasher.combine(_:)`
  with each of these components.
  Important

  In your implementation of `hash(into:)`,
  don't call `finalize()` on the `hasher` 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)

- `


  ### [EstimatedSavings](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EstimatedSavings.md.txt)


  ` Estimated savings accrued over a period of time, relative to a comparison scenario.

  #### Declaration

  Swift

      struct EstimatedSavings

- `


  ### [ModelInfo](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/ModelInfo.md.txt)


  ` Identifies the model used to generate a simulation input series.

  #### Declaration

  Swift

      struct ModelInfo

- `


  ### [TargetOverrides](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/TargetOverrides.md.txt)


  ` Overrides for heating and cooling targets.

  #### Declaration

  Swift

      struct TargetOverrides

- `


  ### [DeviceSettingsChanges](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/DeviceSettingsChanges.md.txt)


  ` Changes to a specific device's settings.

  #### Declaration

  Swift

      struct DeviceSettingsChanges

- `


  ### [Scenario](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/Scenario.md.txt)


  ` A scenario to be simulated.

  #### Declaration

  Swift

      struct Scenario

- `


  ### [AggregatedRuntime](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/AggregatedRuntime.md.txt)


  ` Aggregated runtime for a specific HVAC runtime type.

  #### Declaration

  Swift

      struct AggregatedRuntime

- `


  ### [ScenarioResult](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/ScenarioResult.md.txt)


  ` Results of a scenario simulation.

  #### Declaration

  Swift

      struct ScenarioResult

- `


  ### [EnergyTariffSnapshot](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EnergyTariffSnapshot.md.txt)


  ` Summary of an energy tariff.

  #### Declaration

  Swift

      struct EnergyTariffSnapshot

- `


  ### [HvacSystemSizeSnapshot](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/HvacSystemSizeSnapshot.md.txt)


  ` Summary of an HVAC system size.

  #### Declaration

  Swift

      struct HvacSystemSizeSnapshot

- `


  ### [ModelType](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/ModelType.md.txt)


  ` How the data for a simulation input series is generated.

  #### Declaration

  Swift

      enum ModelType

- `


  ### [StandardScenarioType](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/StandardScenarioType.md.txt)


  ` Pre-defined simulation scenarios. These could be deduced from the specification, but an enum
  makes them easier for a client to look up.

  #### Declaration

  Swift

      enum StandardScenarioType

- `


  ### [AggregationType](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/AggregationType.md.txt)


  ` How the results are aggregated over time.

  #### Declaration

  Swift

      enum AggregationType

- `


  ### [TimeSeriesGranularity](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/TimeSeriesGranularity.md.txt)


  ` The length of each entry in a savings time series.

  #### Declaration

  Swift

      enum TimeSeriesGranularity

- `


  ### [getSavingsTimeSeries(startTime:durationDays:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait.md.txt#/s:15GoogleHomeTypes0A0O27EnergyScenarioAnalysisTraitV20getSavingsTimeSeries05startJ012durationDaysAE03GetijK7CommandV8ResponseV10Foundation4DateVSg_s5Int32VSgtYaKF)


  ` Command to read a time series of estimated savings for this structure over a requested window.
  The series is assembled from stored analysis events rather than from this trait, so it can
  span many periods and extend into the future, where the trait holds only a running total to
  date.

  #### Declaration

  Swift

      func getSavingsTimeSeries(startTime: Date? = nil, durationDays: Int32? = nil) async throws -> Google.EnergyScenarioAnalysisTrait.GetSavingsTimeSeriesCommandResponse

  #### Parameters

  |---|---|
  | ` startTime ` | Start of the requested window, represented as midnight (00:00:00) UTC on the start date. The response is bounded by how much analysis history has been retained, so it may begin later than this. |
  | ` durationDays ` | Length of the requested window in days. The window may extend into the future to request projected savings. |

- `


  ### [EnergyScenarioAnalysisEvent](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/EnergyScenarioAnalysisTrait/EnergyScenarioAnalysisEvent.md.txt)


  ` Event containing simulation results and assumptions.

  #### Declaration

  Swift

      struct EnergyScenarioAnalysisEvent