Battery Trait (batt)

Battery trait for things which are backed by a battery.

AttributeValue
Idtag:google.com,2018:m2m:traits:battery:v1:v0#r0
Short-Idbatt
Has-Childrenno

All of the properties in this trait are optional, but some properties have defined relationships with other properties that, if present, should be maintained.

Some Things may simply adopt this trait and implement none of the properties simply to indicate that it is battery-powered. Others might only want to indicate if the battery is low, but offer no additional information about the charge level or capacity.

On the other hand, some things might implement most of these properties, providing a rich amount of detail on the overall state and health of the battery.

State Properties

NameKeyRWReqDescription
ChargeRemainings/batt/vpctXRemaining battery charge, as a percentage.
EnergyRemainings/batt/vnrgXEnergy remaining, in milliwatt-hours.
NeedsServices/batt/sreqXXBattery service-needed indicator.
ChargeStates/batt/statXRechargable battery state
CapacityRemainings/batt/rcapXCapacity of the battery currently, relative to factory design capacity.
ChargeCycless/batt/cyclXTotal number of battery recharge cycles.
CellVoltages/batt/celVXThe voltages of the individual cells (or banks of cells) in the battery.

s/batt/vpct : ChargeRemaining

Remaining battery charge, as a percentage.

AttributeValue
Value Typepercentage (0.0-1.0)
FlagsGET, OBS

This field is optional, but highly recommended. If implemented, the value of this field is defined to be the following:

  • Primary/Nonrechargable: energyRemaining divided by energyCapacity
  • Secondary/Rechargeable: energyRemaining divided by the product of capacityRemaining and energyCapacity.

s/batt/vnrg : EnergyRemaining

Energy remaining, in milliwatt-hours.

AttributeValue
Value Typereal number
FlagsGET, OBS

If implemented, the value of this field is defined to be the following:

  • Primary/Nonrechargable: The product of chargeRemaining and energyCapacity,
  • Secondary/Rechargeable: The product of chargeRemaining and capacityRemaining and energyCapacity.

s/batt/sreq : NeedsService

Battery service-needed indicator.

AttributeValue
Value Typeboolean
FlagsREQ, GET, OBS

True if the battery needs to be serviced, false otherwise. For example, this would become "true" if the battery was considered low.

s/batt/stat : ChargeState

Rechargable battery state.

AttributeValue
Value Typetext string
FlagsGET, OBS

String describing the current state of the battery:

  • charged: Battery is fully charged. Connected to external power.
  • charging: Battery is currently charging from external power.
  • discharging: Battery is discharging normally.
  • low: Battery is discharging but little power remains.
  • disconnected: Battery has been disconnected, power being provided externally.
  • trouble: Something is wrong with the battery or charging system.

s/batt/rcap : CapacityRemaining

Capacity of the battery currently, relative to factory design capacity.

AttributeValue
Value Typepercentage (0.0-1.0)
FlagsGET, OBS

Only used for rechargeable batteries. This is a ratio of the current maximum capacity of the battery versus the maximum capacity of the battery when it was new.

s/batt/cycl : ChargeCycles

Total number of battery recharge cycles.

AttributeValue
Value Typereal number
FlagsGET, OBS

Only used for rechargeable batteries.

s/batt/celV : CellVoltage

The voltages of the individual cells (or banks of cells) in the battery.

AttributeValue
Value Typearray containing arrays containing real numbers
FlagsGET, OBS

This can be used to determine the general health of the battery pack.

Metadata Properties

NameKeyRWReqDescription
EnergyCapacitym/batt/enrgXThe factory design energy capacity of the battery when new and fully charged, in milliwatt-hours.
NominalBatteryVoltagem/batt/voltXThe nominal voltage of the battery.
NominalCellVoltagem/batt/celVXThe nominal voltage of a cell in the battery.
CellCountm/batt/ccntXThe number of cells in the battery.
Rechargablem/batt/rechXIndicates if the battery is rechargeable or not.

m/batt/enrg : EnergyCapacity

The factory design energy capacity of the battery when new and fully charged, in milliwatt-hours.

AttributeValue
Value Typeinteger
FlagsGET

The maximum energy capacity value is around 2 megawatt-hours.

m/batt/volt : NominalBatteryVoltage

The nominal voltage of the battery.

AttributeValue
Value Typereal number
FlagsGET

m/batt/celV : NominalCellVoltage

The nominal voltage of a cell in the battery.

AttributeValue
Value Typereal number
FlagsGET

m/batt/ccnt : CellCount

The number of cells in the battery.

AttributeValue
Value Typeinteger
FlagsGET

m/batt/rech : Rechargable

Indicates if the battery is rechargeable or not.

AttributeValue
Value Typeboolean
FlagsGET

Associated Constants

NameValueDescription
CHARGE_STATE_CHARGED"charged"Battery is fully charged. Connected to external power.
CHARGE_STATE_CHARGING"charging"Battery is currently charging from external power.
CHARGE_STATE_DISCHARGING"discharging"Battery is discharging normally.
CHARGE_STATE_LOW"low"Battery is discharging but little power remains.
CHARGE_STATE_DISCONNECTED"disconnected"Battery has been disconnected, power being provided externally.
CHARGE_STATE_TROUBLE"trouble"Something is wrong with the battery or charging system.