Battery
Devices using default battery configuration will only have reporting enabled for the PercentageRemaining attribute.
- class st.zigbee.defaults.battery.BatteryVoltageConfiguration
- cluster: number
PowerConfiguration ID 0x0001
- attribute: number
BatteryVoltage ID 0x0020
- minimum_interval: number
30 seconds
- maximum_interval: number
21600 seconds (6 hours)
- data_type: st.zigbee.data_types.Uint8
the Uint8 class
- reportable_change: number
1 (.1 volts)
- class st.zigbee.defaults.battery.BatteryPercentageConfiguration
- cluster: number
PowerConfiguration ID 0x0001
- attribute: number
BatteryPercentageRemaining ID 0x0021
- minimum_interval: number
30 seconds
- maximum_interval: number
21600 seconds (6 hours)
- data_type: st.zigbee.data_types.Uint8
the Uint8 class
- reportable_change: number
1 (.5 percent)
- class st.zigbee.defaults.battery
- zigbee_handlers: table
- attribute_configurations: table
- capability_handlers: table
- default_voltage_configuration: st.zigbee.defaults.battery.BatteryVoltageConfiguration
- default_percentage_configuration: st.zigbee.defaults.battery.BatteryPercentageConfiguration
- DEVICE_MIN_VOLTAGE_KEY: str
a device field name to set the minimum voltage for default battery
- DEVICE_MAX_VOLTAGE_KEY: str
a device field name to set the maximum voltage for default battery
- DEVICE_VOLTAGE_TABLE_KEY: str
a device field name to set a table for voltage entries in default handling
- static build_linear_voltage_init(bat_min, bat_max)
Build a function to set the devices battery_defaults.DEVICE_MIN_VOLTAGE_KEY and
battery_defaults.DEVICE_MAX_VOLTAGE_KEY in a devices init function to leverage the battery voltage default handler for alternative min and max volts. Will also disable battery percentage remaining attribute configuration and monitoring.
- Parameters
bat_min (
number) – the minimum voltage to consider for this devices scalingbat_max (
number) – the maximum voltage to consider for this devices scaling
- Return type
fun(ZigbeeDriver, st.zigbee.Device, str, table)
- static enable_battery_voltage_table(device, battery_table)
Enable the usage of a voltage to battery percentage table for reporting battery.
Will also disable battery percentage remaining attribute configuration and monitoring.
- Parameters
device (
st.zigbee.Device) – The device this message was received from containing identifying informationbattery_table (
table) – a map of battery voltages to battery percentages