zigbee-window-treatment: Don't halve battery percentage for IKEA devices#3103
zigbee-window-treatment: Don't halve battery percentage for IKEA devices#3103pachuho wants to merge 1 commit into
Conversation
IKEA blinds report BatteryPercentageRemaining in 1% units (0-100) rather than the 0.5% units defined by the ZCL spec, so the default handler shows them at half their real charge (a full battery reads ~50% in the app). Add an IKEA subdriver that emits the reported value as-is, the same way the zigbee-button and zigbee-dimmer-remote drivers already handle IKEA battery reports. Fixes SmartThingsCommunity#2679
|
Thanks for submitting the PR. As noted on the Github issue, the battery reporting behavior does seem to vary by FW version, so we'll want to incorporate that into the fix so that devices that follow the ZCL spec continue to have their battery level reported correctly. I'm trying to figure out exactly what versions have the issue, and then can either provide that info to you if you want to add to your PR or we can put up a fix for it. |
https://community.smartthings.com/t/smartthings-shades-window-treatment-driver-bug/307114/8 |
I have seen some versions before 24.x that seem to report correctly as well ,so I'm checking with the manufacturer to determine exactly what firmware versions have the issue. |
@tpmanley Is it now possible to check the FW version in a Zigbee driver? It used to be possible, I used it for my custom drivers for IKEA buttons that had the same issue with old/new firmwares but eventually the feature was removed (see this thread at the Community) and had to resort to a manual setting by the user which is a bad user experience when it used to be automatic. |
This addresses #2679.
IKEA blinds (FYRTUR/KADRILJ) report
BatteryPercentageRemainingin 1% units (0–100) rather than the 0.5% units defined by the ZCL spec, so the default handler halves the value and a fully charged battery shows ~50% in the app.This adds an IKEA subdriver that emits the reported value as-is. The repo already handles IKEA battery reports this way in two other drivers —
zigbee-button(zigbee-multi-button/ikea/init.lua) andzigbee-dimmer-remote(IKEAofSweden/init.lua) — so this bringszigbee-window-treatmentin line with that existing convention.The subdriver matches on manufacturer only, mirroring the
zigbee-buttonprecedent; both IKEA entries in this driver'sfingerprints.ymlreportIKEA of Sweden.Added battery test cases to
test_zigbee_window_shade_battery_ikea.lua(which previously only covered window shade states). All zigbee-window-treatment tests pass locally againstlua_libs-api_v20.Fixes #2679