-
Notifications
You must be signed in to change notification settings - Fork 521
Description
Summary
When using the stock SmartThings zigbee-window-treatment Edge driver, IKEA blinds show a battery percentage that is exactly cut in half (e.g., a freshly charged battery shows ~50% instead of ~100%). Switching to Mariano’s community driver shows the correct battery percentage.
This makes the built-in driver feel “partially supported” for IKEA blinds, even though they are now matched by the stock driver.
Affected devices
- Manufacturer:
IKEA of Sweden - Device: IKEA smart blinds / window treatments (e.g., FYRTUR/KADRILJ/TREDANSEN)
Steps to reproduce
- Pair an IKEA blind to a SmartThings hub.
- Assign it to the stock driver:
SmartThings / zigbee-window-treatment(default/official driver). - Fully charge the IKEA battery pack and reinsert it (or otherwise ensure the blind reports a “full” battery).
- Check the battery percentage in the SmartThings app.
Actual behavior
Battery is displayed at ~50% when it should be ~100% (i.e., it appears halved).
Expected behavior
Battery is displayed correctly (e.g., ~100% after a full charge).
Analysis / likely root cause
Zigbee PowerConfiguration -> BatteryPercentageRemaining (0x0001 / 0x0021) is commonly interpreted as 0.5% units (0–200), so many handlers divide by 2 to convert to 0–100%.
However, IKEA blinds appear to report BatteryPercentageRemaining already in 1% units (0–100). If the handler divides by 2 anyway, the displayed value becomes half of the real percentage.
The stock driver currently registers default handlers (including Battery) without an IKEA-specific exception:
- Stock driver init.lua: https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/tree/main/drivers/SmartThings/zigbee-window-treatment/src
Mariano’s driver fixes this by skipping the divide-by-2 for IKEA:
local function battery_perc_attr_handler(driver, device, value, zb_rx)
if device:get_manufacturer() ~= "IKEA of Sweden" then
value.value = math.floor(value.value / 2.0 + 0.5)
end
device:emit_event_for_endpoint(zb_rx.address_header.src_endpoint.value,
capabilities.battery.battery(value.value))
endSource
Mariano’s IKEA subdriver (reference implementation):
Proposed fix
Add IKEA-specific battery handling in the stock zigbee-window-treatment driver, for example:
- Add a small IKEA subdriver that overrides the attribute handler for:
PowerConfiguration.attributes.BatteryPercentageRemaining
- For
device:get_manufacturer() == "IKEA of Sweden", treatvalue.valueas already 0–100 and do not halve it (still clamp to 0–100). - Keep the existing/default behavior for other manufacturers/devices.
- Alternative approach: implement a manufacturer/model exception directly in the driver’s battery handling, but a subdriver keeps the logic isolated and consistent with other vendor quirks.
Related discussion
SmartThings Community thread: