Homey Apps SDK
📖 Apps SDK Reference🌍 Web API🛠 Developer Tools
  • Welcome to the Apps SDK documentation 👋
  • The Basics
    • Getting Started
      • Homey CLI
    • App
      • Manifest
      • Internationalization
      • Permissions
      • Persistent Storage
    • Drivers & Devices
      • Pairing
        • System Views
          • Devices List
          • Add Devices
          • OAuth2 Login
          • Credentials Login
          • Pincode
          • Loading
          • Done
        • Custom Views
      • Capabilities
      • Energy
      • Settings
      • Best practices
        • Lights
        • Window coverings
        • Battery status
    • Flow
      • Arguments
      • Tokens
    • Widgets
      • Settings
      • Styling
      • Debugging
  • Wireless
    • Wi-Fi
      • Discovery
    • Bluetooth LE
    • Z-Wave
    • Zigbee
    • 433 MHz
    • Infrared
    • Matter
  • Cloud
    • OAuth2
    • Webhooks
  • App Store
    • Publishing
    • Guidelines
    • Verified Developer
    • Updating
  • Advanced
    • Custom Views
      • App Settings
      • Custom Pairing Views
      • HTML & CSS Styling
    • Web API
    • Images
    • LED Ring
    • Homey Compose
  • Guides
    • Homey Cloud
    • Breaking Changes
    • Tools
      • Bluetooth LE
      • Zigbee
      • TypeScript
    • Using ESM in Homey Apps
  • Upgrade Guides
    • Homey v6.0.0
    • Upgrading to SDK v3
      • Zigbee Apps
    • Device Capabilities
Powered by GitBook
On this page

Was this helpful?

  1. The Basics
  2. Drivers & Devices
  3. Best practices

Battery status

Best practices for devices with batteries.

PreviousWindow coveringsNextFlow

Last updated 1 year ago

Was this helpful?

A device which can report its battery level can do so in two ways:

  1. Report when the battery is empty or low.

  2. Report the precise battery level that is left.

Give your driver the measure_battery capability if it supports reporting precise battery levels on a certain numeric scale (e.g. 0-100%). Give your driver the alarm_battery capability if it supports alarm notifications when the battery level reaches a certain threshold (e.g. 'battery level less than 10%).

Never give your driver both the measure_battery and the alarm_battery capabilities. This creates duplicate UI components and Flow cards.

Battery devices must specify an energy object with the batteries property. This should be set to an array of strings which represent the batteries in the device. For example, a device with 2 AAA batteries must specify the following energy object:

/drivers/<driver_id>/driver.compose.json
{
  "name": { "en": "My Driver" },
  "images": {
    "small": "/drivers/my_driver/assets/images/small.png",
    "large": "/drivers/my_driver/assets/images/large.png"
  },
  "class": "sensor",
  "capabilities": ["measure_battery"],
  "energy": {
    "batteries": ["AAA", "AAA"]
  }
}

For more information check the .

Energy documentation