<!--
{
  "availability" : [
    "iOS: 26.1.0 -",
    "iPadOS: 26.1.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "EnergyKit",
  "identifier" : "/documentation/EnergyKit/ElectricityInsightRecord/dataByGridCleanliness",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "EnergyKit"
    ],
    "preciseIdentifier" : "s:9EnergyKit24ElectricityInsightRecordV21dataByGridCleanlinessAC0hI0Vyx_GSgvp"
  },
  "title" : "dataByGridCleanliness"
}
-->

# dataByGridCleanliness

Energy consumption or production, or device operational runtime categorized by the cleanliness of the grid electricity.

```
var dataByGridCleanliness: ElectricityInsightRecord<Measure>.GridCleanliness?
```

## Discussion

This property returns electricity usage data organized by how environmentally friendly the production of the energy is. The electricity usage data refers to either energy consumption or generation measurements, or amounts of time that an electrical device is operational and consuming energy. The type of the returned value depends on the insight record’s generic type parameter:

- [`ElectricityInsightRecord`](/documentation/EnergyKit/ElectricityInsightRecord)<<doc://com.apple.documentation/documentation/Foundation/Measurement><<doc://com.apple.documentation/documentation/Foundation/UnitEnergy>>> instances return <doc://com.apple.documentation/documentation/Foundation/Measurement><<doc://com.apple.documentation/documentation/Foundation/UnitEnergy>> for this property.
- [`ElectricityInsightRecord`](/documentation/EnergyKit/ElectricityInsightRecord)<<doc://com.apple.documentation/documentation/Swift/Duration>> instances return <doc://com.apple.documentation/documentation/Swift/Duration> for this property.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)