Appearance
traits/energy_storage.proto
Table of Contents
traits/energy_storage.proto
ChargeRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | Name of the device | |
charge | bool | True to begin charging, false to stop. |
ChargeResponse
DescribeEnergyLevelRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device |
EnergyLevel
EnergyLevel describes properties related to the current and potential charge levels of the device.
Field | Type | Label | Description |
---|---|---|---|
discharge | EnergyLevel.Transfer | Discharge denotes that the device is currently decreasing its energy level. An empty transfer object is valid and says: this device is discharging. | |
charge | EnergyLevel.Transfer | Charge denotes that the device is currently increasing its energy level. An empty transfer object is valid and says: this device is charging. | |
idle | EnergyLevel.Steady | Idle denotes that the device is neither increasing or decreasing its energy level. | |
quantity | EnergyLevel.Quantity | Quantity describes an absolute energy level using different units. | |
plugged_in | bool | Is the device plugged in. |
EnergyLevel.Quantity
Quantity describes an absolute energy level using different units.
Field | Type | Label | Description |
---|---|---|---|
percentage | float | [0, 100] | |
energy_kwh | float | ||
descriptive | EnergyLevel.Quantity.Threshold | descriptive defines preset descriptive quantities for the energy level of the device. Numeric values should be preferred if provided. | |
distance_km | float | A measure of how far the device can travel with its current energy level. |
EnergyLevel.Steady
Steady describes a non-changing energy level.
Field | Type | Label | Description |
---|---|---|---|
start_time | google.protobuf.Timestamp |
EnergyLevel.Transfer
Transfer describes how energy is being transferred, either into or out of the device. See discharge and charge for information on the direction of the transfer.
Field | Type | Label | Description |
---|---|---|---|
start_time | google.protobuf.Timestamp | Start time describes when this transfer started | |
time | google.protobuf.Duration | How long until the transfer is complete. Measured relative to the current time according to the devices clock. | |
distance_km | float | How many more kilometers need to be travelled before the transfer is complete. For example when discharging, this might represent kilometers until the battery is empty. | |
speed | EnergyLevel.Transfer.Speed | Speed describes relative transfer speed for the device. | |
target | EnergyLevel.Quantity | The planned end values for the transfer. There is no guarantee that the transfer will reach these values, but they are useful for informational and planning purposes. |
EnergyLevelSupport
EnergyLevelSupport describes the capabilities of devices implementing this trait.
Field | Type | Label | Description |
---|---|---|---|
resource_support | smartcore.types.ResourceSupport | How a named device supports read/write/pull apis | |
rechargeable | bool | A true value indicates that the device can be recharged. A rechargeable device should report charging and until_full where appropriate. | |
charge_control | EnergyLevelSupport.ChargeControl | A description of how the charge status of the device can be changed. |
GetEnergyLevelRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | Name of the device to fetch the state for | |
read_mask | google.protobuf.FieldMask | Fields to fetch relative to the EnergyLevel type |
PullEnergyLevelRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | Name of the device to fetch the state for | |
read_mask | google.protobuf.FieldMask | Fields to fetch relative to the EnergyLevel type | |
updates_only | bool | When true the device will only send changes to the resource value. The default behaviour is to send the current value immediately followed by any updates as they happen. |
PullEnergyLevelResponse
Field | Type | Label | Description |
---|---|---|---|
changes | PullEnergyLevelResponse.Change | repeated | Changes since the last message |
PullEnergyLevelResponse.Change
Field | Type | Label | Description |
---|---|---|---|
name | string | name for the device that issued the change | |
change_time | google.protobuf.Timestamp | when the change occurred | |
energy_level | EnergyLevel | The new value for the energy level |
EnergyLevel.Quantity.Threshold
Threshold defines preset descriptive quantities for the energy level of the device. Numeric values will be preferred if provided.
Name | Number | Description |
---|---|---|
THRESHOLD_UNSPECIFIED | 0 | |
CRITICALLY_LOW | 1 | |
EMPTY | 2 | |
LOW | 3 | |
MEDIUM | 4 | |
HIGH | 5 | |
FULL | 7 | |
CRITICALLY_HIGH | 8 |
EnergyLevel.Transfer.Speed
Speed defines descriptive relative energy transfer speeds for a device. Larger enum values will always be faster than smaller enum values.
Comparing two devices speeds is not defined, one device that is FAST and another that is SLOW does not guarantee that either device will transfer energy quicker than the other.
Name | Number | Description |
---|---|---|
SPEED_UNSPECIFIED | 0 | |
EXTRA_SLOW | 1 | |
SLOW | 2 | |
NORMAL | 3 | |
FAST | 4 | |
EXTRA_FAST | 5 |
EnergyLevelSupport.ChargeControl
Name | Number | Description |
---|---|---|
CHARGE_CONTROL_UNSPECIFIED | 0 | |
NONE | 1 | Charge status cannot change. Typically this is because the device is not rechargeable. |
DEVICE | 2 | The device may change the charge status, calling Charge will not affect it and will return an error. |
EXTERNAL | 3 | Calling Charge can change the charge status. The device will not change it on its own. |
ALL | 4 | Both the device and calling Charge can change the charge status. |
EnergyStorageApi
Trait for devices that can store energy or charge another device. Typically applied devices with batteries or chargers of those devices.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
GetEnergyLevel | GetEnergyLevelRequest | EnergyLevel | GetEnergyLevel retrieves the current charge level and potential charge level for the device. |
PullEnergyLevel | PullEnergyLevelRequest | PullEnergyLevelResponse stream | PullEnergyLevel subscribes to changes in energy level. |
Charge | ChargeRequest | ChargeResponse | Charge starts or stops the device charging. If the device is not plugged in then this will return a FAILED_PRECONDITION error. Devices may start or stop charging on their own. |
EnergyStorageInfo
Describes the capabilities of a specific named device with respect to this trait.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
DescribeEnergyLevel | DescribeEnergyLevelRequest | EnergyLevelSupport | Get information about how a named device implements EnergyLevel features |