-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Zha battery #16384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Zha battery #16384
Changes from all commits
Commits
Show all changes
10000 commits
Select commit
Hold shift + click to select a range
7652064
Update neato to support new StateVacuumDevice (#16035)
dshokouhi 55b7fdb
vacuum/xiaomi_miio: Expose "sensor_dirty_left" attribute (#16003)
klada 2dcfde6
Add forgiving add column (#16057)
balloob 2fc0afc
Tuya fix login problem and add login platform param (#16058)
huangyupeng 75fca41
Add notify platforms to loaded components (#16063)
balloob 618cf6b
Column syntax fix + Add a file if migration in progress (#16061)
balloob f25430e
Add forgiving add column (#16057)
balloob 6f4306f
Tuya fix login problem and add login platform param (#16058)
huangyupeng 86a4e35
Add notify platforms to loaded components (#16063)
balloob cc70f95
Bumped version to 0.76.1
balloob f2d756f
Column syntax fix + Add a file if migration in progress (#16061)
balloob 723d53f
Merge pull request #16064 from home-assistant/rc
balloob a739b0f
Grammar and spelling fixes (#16065)
scop fb775b6
Update frontend to 20180820.0
balloob b52beaa
Update frontend to 20180820.0
balloob 38b2a5c
Use aiohttp web.AppRunner (#16020)
balloob 9a42276
Update pushsafer.py (#16060)
appzer 71ff499
Alexa: context + log events (#16023)
balloob 30ce29a
openuv: Add Current UV Level to list of conditions (#16042)
leppa 4122fb7
TpLink Device Tracker Error (#15918)
TimBailey-pnk a7ee41f
Deprecated stuff (#16019)
balloob e0337cc
Add recent context (#15989)
balloob 422fab6
Add ecovacs component (#15520)
OverloadUT 8151e85
Bumped NDMS2 client library to 0.0.4 to get compatible with python 3.…
foxel 6841a36
fritzdect change to current_power_w (#16079)
Danielhiversen 9bbd656
Update pyhomematic to 0.1.47 (#16083)
danielperna84 fb867c9
Get user after login flow finished (#16047)
awarecan d66d24f
Upgrade pytest to 3.7.2 (#16091)
scop c5432f4
Forgiving add index in migration (#16092)
balloob eb56c2b
Forgiving add index in migration (#16092)
balloob d93b04b
Bumped version to 0.76.2
balloob a1d8050
Merge pull request #16094 from home-assistant/rc
balloob 3229a98
Add verify ssl to generic camera (#15949)
fliphess 146d14c
Upgrade afsapi to 0.0.4, prevents aiohttp session close message, Fixe…
zhelev f4d0454
Remove homeassistant.remote (#16099)
balloob f681c14
Use new session when fetching remote urls (#16093)
balloob 44a3257
Allow finish_flow callback to change data entry result type (#16100)
awarecan 09bfe99
Add support for revoking refresh tokens (#16095)
balloob 1f9a133
Refactoring login flow (#16104)
awarecan 5a9e070
Minor updates (#16106)
fabaff 3b4d783
Bump python-miio version (#16110)
syssi 9feb51f
homematic: Add homematic.put_paramset service (#16024)
klada e30fb6f
Upgrade shodan to 1.9.1 (#16113)
fabaff 2c47ec1
Upgrade sendgrid to 5.6.0 (#16111)
fabaff 349457d
Merge insteon_plm and insteon_local to insteon component (#16102)
teharris1 5062641
Remove unit_of_measurement from climate entities (#16012)
jeradM eb930d3
Add multi-factor authentication modules (#15489)
awarecan 678025e
Device Registry (#15980)
Kane610 0115a11
Check correctly if package is loadable (#16121)
balloob bfe8a9a
Upgrade numpy to 1.15.1 (#16126)
fabaff 2fd09a2
Upgrade youtube_dl to 2018.08.22 (#16125)
fabaff 800db0c
Fix the protocol v2 data_key of several aqara devices (#16112)
syssi 358562d
Upgrade brunt package (#16130)
eavanvalkenburg 7e27ded
Add support for NOAA tide information (new PR) (#15947)
jcconnell c14b3a7
Adds support for routers implementing IGDv2 (#16108)
dgomes 054fe9b
Add support for JS modules in custom panels (#16096)
villanyibalint ea4fce1
Prevent legacy api password with empty password (#16127)
balloob ba0cc5f
Enable auth by default 🙈 (#16107)
balloob 51d179e
Remove commented out API password from default config (#16147)
balloob 96d6fc9
Spelling fixes (#16150)
scop 5bec8b9
Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0 (#14557)
scop 163fd26
Hangouts (#16049)
hobbypunk90 045ff3f
Bump frontend to 20180824.0
balloob 631c02d
Update translations
balloob 9b51c84
Hangouts localization typo fix (#16174)
emlove f187172
deCONZ - Allow sub second light transitions (#16170)
Kane610 73f205f
add_devices -> add_entities (#16171)
balloob 1a496a8
Merge remote-tracking branch 'origin/master' into dev
balloob d272bc3
Bumped version to 0.77.0b0
balloob 7675624
Add multi-factor auth module setup flow (#16141)
awarecan a6bf5f4
deCONZ - Support device registry (#16115)
Kane610 296dfdb
fix error message for cv.matches_regex (#16175)
heythisisnate 06f6791
Decouple Konnected entity setup from discovery (#16146)
heythisisnate 1915dcf
Add 'moon_phase' to Dark Sky sensor (#16179)
fabaff 4129a77
Tweak log level for bearer token warning (#16182)
awarecan 5ff7e6e
Device registry store config entry (#16152)
Kane610 7e6647d
Fix hangouts (#16180)
balloob 921a265
Default load trusted_network auth provider if configured trusted netw…
awarecan 35d501e
Bump frontend to 20180825.0
balloob cf2bb43
Bump frontend to 20180825.0
balloob 8c59130
deCONZ - Support device registry (#16115)
Kane610 ac613a0
Add multi-factor auth module setup flow (#16141)
awarecan d47825f
Decouple Konnected entity setup from discovery (#16146)
heythisisnate d682fba
Device registry store config entry (#16152)
Kane610 1eb5ee7
fix error message for cv.matches_regex (#16175)
heythisisnate b0eaa65
Fix hangouts (#16180)
balloob 7783e03
Tweak log level for bearer token warning (#16182)
awarecan 28416ca
Default load trusted_network auth provider if configured trusted netw…
awarecan 1164d3f
Bumped version to 0.77.0b1
balloob 162ec80
Zoneminder SSL fix (#16157)
djm300 1ec363d
update python-velbus library version (#16194)
thomasdelaet 5675aef
MQTT: Log transmitted as well as received messages (#16195)
smurfix d929608
homematic: Make device avilable again when UNREACH becomes False (#16…
klada db6895f
Upgrade sqlalchemy to 1.2.11 (#16192)
fabaff f099521
Add battery warning, rssi level and check for availability (#16193)
fucm cf9aabd
Revert changes to platforms using self.device (#16209)
Kane610 eba2e8d
Inconsistent entity_id when multiple sensors (#16205)
grea09 7ffbdae
remove hangouts.users state, simplifies hangouts.conversations (#16191)
hobbypunk90 2fc1e68
Handle exception from pillow (#16190)
PhracturedBlue 28f1708
Update frontend to 20180826.0
balloob e8398ac
Update frontend to 20180826.0
balloob 3ffcbf2
Update aiohttp to version 3.4.0. (#16198)
Swamp-Ig eb490ac
Add Time-based Onetime Password Multi-factor Authentication Module (#…
awarecan 23ea342
Replace pbkdf2 with bcrypt (#16071)
Eriner 287a4ea
Replace pbkdf2 with bcrypt (#16071)
Eriner 917fdde
Add Time-based Onetime Password Multi-factor Authentication Module (#…
awarecan fa0fda1
Handle exception from pillow (#16190)
PhracturedBlue 7db240d
remove hangouts.users state, simplifies hangouts.conversations (#16191)
hobbypunk90 d77b106
Update aiohttp to version 3.4.0. (#16198)
Swamp-Ig 069e210
Revert changes to platforms using self.device (#16209)
Kane610 577a134
Update translations
balloob 6e7c323
Update translations
balloob a42b3ba
Add new translations
balloob babed8f
Bumped version to 0.77.0b2
balloob a5e8a16
Add temperature sensors to the velbus component (#16203)
cereal2nd 36be758
Rewrite of Trafikverket weather - Multiple sensor types supported (#1…
endor-force 08b6ce7
Add device_tracker.bluetooth_update service (#15252)
kariudo 2b71824
Fix geizhals price parsing (#15990)
JulianKahnert 271d53e
Add new translations
balloob 31cb215
Update translations
balloob 9f34d60
Update translations
balloob 510a751
Change auth warning (#16216)
balloob f0aa18f
Add Volkszaehler sensor (#16188)
fabaff d74840f
openalpr flag `WITH_TEST` should be `WITH_TESTS` (#16218)
vrih 8ad5050
Fix device telldus (#16224)
balloob 3db4716
Upgrade alpha_vantage to 2.1.0 (#16217)
fabaff a9d6ab3
Bump frontend to 20180827.0
balloob 5198d6f
Bump frontend to 20180827.0
balloob 80f1082
rewrite hangouts to use intents instead of commands (#16220)
hobbypunk90 9c7abcc
Store devices as dict instead of list (#16229)
Kane610 495b437
Update trusted networks flow (#16227)
balloob 0855606
homematic: Make device avilable again when UNREACH becomes False (#16…
klada 0bae5ba
Change auth warning (#16216)
balloob e31cf92
rewrite hangouts to use intents instead of commands (#16220)
hobbypunk90 07dee35
Fix device telldus (#16224)
balloob 0c63736
Update trusted networks flow (#16227)
balloob fcf901b
Bumped version to 0.77.0b3
balloob 7f41a13
Warning missed a space (#16233)
balloob 00e5d47
Package loadable: compare case insensitive (#16234)
balloob 4ae9bc1
Change log level to error when auth provider failed loading (#16235)
awarecan ea9a50e
Avoid insecure pycryptodome (#16238)
balloob 5f24893
Improve package loadable (#16237)
balloob 50e31d3
Fix hangouts (#16232)
balloob dee4a8a
Blow up startup if init auth providers or modules failed (#16240)
awarecan 2b2c162
Update translations
balloob f9feab9
Update translations
balloob 05ab3e5
Fix hangouts (#16232)
balloob 54654ca
Warning missed a space (#16233)
balloob fae25da
Package loadable: compare case insensitive (#16234)
balloob e4821c0
Avoid insecure pycryptodome (#16238)
balloob de86f32
Change log level to error when auth provider failed loading (#16235)
awarecan fc7d81b
Blow up startup if init auth providers or modules failed (#16240)
awarecan a6c44c0
Bumped version to 0.77.0b4
balloob 3af1dcd
def device shouldnt call it self but self._device (#16255)
Kane610 3dd2a03
Tweak MFA login flow (#16254)
awarecan c35e587
Bump frontend to 20180829.0
balloob 1136cff
Bump frontend to 20180829.0
balloob ffe92b1
Update translations
balloob b398c72
Update translations
balloob bfa3bfe
Tweak MFA login flow (#16254)
awarecan ce08fe7
def device shouldnt call it self but self._device (#16255)
Kane610 811eb9a
Version bump to 0.77.0
balloob dd8c05f
Merge pull request #16256 from home-assistant/rc
balloob 3cea8fb
Merge branch 'master' into dev
balloob 833eb21
Version bump to 0.78.0.dev0
balloob 7f75ac2
Switchmate (#15535)
Danielhiversen 67630e5
Add support for discrete states to MyQ cover (#16251)
schmittx 7cd9538
bump version (#16262)
dgomes f4e2ab6
Replace Authorization by Authentication (#16259)
cgtobi 0b10426
Add device info to Chromecast (#16261)
balloob 343ea05
Add device info for sonos (#16263)
balloob 710c5a3
Add device info Nest (#16265)
balloob 4fae425
Add Hue device info (#16267)
balloob 2a807ef
Nest Thermostat has software version (#16275)
awarecan d227efc
Add support for Habitica (#15744)
asmfreak 3cbb413
Fix data_key override by parent class (#16278)
syssi d7432a8
Bump frontend to 20180829.1
balloob 0f30b30
Fix error when vacuum is idling (#16282)
cnrd 2172245
Fix so that entities are properly unloaded with config entry (#16281)
Kane610 2d55606
Bump frontend to 20180829.1
balloob 21c6c2e
Fix data_key override by parent class (#16278)
syssi b305dc6
Fix error when vacuum is idling (#16282)
cnrd bfe0454
Bumped version to 0.77.1
balloob a49d616
Merge pull request #16284 from home-assistant/rc
balloob 5f57b94
Merge branch 'master' into dev
balloob b4f3279
Fix spelling mistake in recorder migration [ci skip]
robbiet480 4ab79cb
Geo Location component (#15953)
exxamalte 84ae51d
Bump songpal dependency (#16297)
rytilahti 245c93c
Use asterisk_mbox 0.5.0 client (#16296)
PhracturedBlue 4067f32
Fix LIFX effects (#16309)
amelchio 7832739
avoid error in debug log mode and rss entry without title (#16316)
exxamalte e153571
Correct wemo static device discovery issue. (#16292)
lamiskin 3b705d6
Update frontend to 20180831.0
balloob 232076b
Update frontend to 20180831.0
balloob e2dc443
Update frontend to 20180831.0
balloob 8be7a0a
Correct wemo static device discovery issue. (#16292)
lamiskin b506526
Correct wemo static device discovery issue. (#16292)
lamiskin 16a58bd
Fix LIFX effects (#16309)
amelchio df26b23
Fix LIFX effects (#16309)
amelchio 0e076fb
avoid error in debug log mode and rss entry without title (#16316)
exxamalte e7d0cd1
avoid error in debug log mode and rss entry without title (#16316)
exxamalte bc618af
Bumped version to 0.77.2
balloob 5efd968
Bumped version to 0.77.2
balloob ec2766a
Update translations
balloob d705375
Update translations
balloob fd1b35c
Update translations
balloob 976626d
Merge pull request #16324 from home-assistant/rc
balloob 5169209
Merge pull request #16324 from home-assistant/rc
balloob 5eebf3f
Upgrade Adafruit-DHT to 1.3.4 (#16327)
thomaslian 4cd5e7a
Add unique ID (#16323)
schmittx 339c7f2
Add Cover to the Insteon component (#16215)
teharris1 0a5a636
Fix missing humidity sensor (#16337)
danielperna84 cb33c19
Support Sonos Beam HDMI input (#16340)
bd06e7b
Make last_seen attribute a timezone aware datetime in UTC (#16348)
pnbruckner ff31a8e
Handle netatmo exception (#16344)
Danielhiversen 697711f
Add support for sound_mode for Yamaha rxv media_player (#16352)
Joshi425 a9ad78a
Add unique_id to MQTT Light (#16303)
bieniu 4811e8b
Update to EnvoyReader 0.2, support for more hardware (#16212)
jesserizzo 1b24892
Snips: Added special slot values, session_id and slotname_raw (#16185)
todschmidt 55033ac
Upgrade hbmqtt to 0.9.4 (#16356)
awarecan 5842f05
Upgrade Sphinx to 1.7.7 (#16359)
fabaff bf966b9
Upgrade qnapstats to 0.2.7 (#16360)
fabaff 4cb8446
Upgrade mutagen to 1.41.1 (#16361)
fabaff 403f70b
Upgrade shodan to 1.10.0 (#16363)
fabaff 64dcfc7
Upgrade to youtube_dl to 2018.09.01 (#16365)
fabaff 03029c3
Added 'nomapnt', 'outcurnt', 'loadapnt' fields (#16176)
MarcSN311 95f5ba8
Generic Thermostat: add support for climate.turn_on/climate.turn_off …
aronsky 54ecf1a
Add support for Tahoma Lighting Receiver on/off io (#15925)
fucm 99c51b3
Update discord.py (#16248)
htotoo 45bfb77
Upgrade python-telegram-bot to 11.0.0 (#16373)
fabaff 695875c
Upgrade attrs to 18.2.0 (#16372)
fabaff b9087c4
Update server.py (#16375)
awarecan 3ea9a83
add_entities for switchmate (#16368)
Danielhiversen 02013ab
Merge remote-tracking branch 'upstream/master' into dev
ryanwinter cfbe696
Merge remote-tracking branch 'upstream/master' into dev
ryanwinter 08351dc
remove await
ryanwinter e0a6263
remove await
ryanwinter e6a4ec0
add battery support to zha
ryanwinter 633f920
add battery support to zha
ryanwinter 82214ad
add battery sensor
ryanwinter 4cf5351
add battery sensor
ryanwinter 93cdc83
Merge remote-tracking branch 'upstream/dev' into zha_battery
ryanwinter 90cb961
Merge remote-tracking branch 'upstream/dev' into zha_battery
ryanwinter 192241e
remove debugging
ryanwinter 06fe2a7
remove debugging
ryanwinter 67fb82d
removed old changes
ryanwinter cef33a9
removed old changes
ryanwinter 7766c4c
fixed whitespace
ryanwinter b70d729
fixed whitespace
ryanwinter 3092100
Merge branch 'zha_battery' of https://github.com/ryanwinter/home-assi…
ryanwinter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Battery voltage is != "battery_percentage_remaining"
I'd use attrid = 33 as the value attributes which translates into "battery_percentage_remaining". You also would need to configure attribute reporting for attr_id=33. The problem is: Centralite sensors unlike SmartThings sensors do not report "battery_percentage_remaining" but this could be addressed through zigpy quirks, which I was actually working on. For now I have linear translation of 'battery_voltate' to 'battery_percentage_remaining', but was working on a reverse exponential translation like in #12515 just want to have a function with defined max/min battery voltage translating into % remaining
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I realised that this wasnt battery percentage, I was thinking that a quirk could be used to convert this to percentage later on. Maybe I will check out the battery_percentage_remaining function and see how that goes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what I have for WIP https://github.com/Adminiuga/zigpy/commits/bat-percent-remain the only thing stopping me from submitting this is the linear battery_voltage --> battery_percentage_remaining conversion as I'd like it to be inverse exponential. Xiaomi battery voltage parsing is based on/inspired by Yoda-X code https://github.com/Yoda-x/ha-zha-new/blob/master/custom_components/device/lumi_sensor_wleak_aq1.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking in the zigbee.db file, I don't see a battery_percentage_remaining attribute for cluster one on my Smartthings sensors, but you mention that smarthing sensors do report this. Does this mean a change needs to happen in zigby?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that depends on the sensor. The one I've got https://www.amazon.com/Samsung-SmartThings-Multipurpose-Sensor-GP-U999SJVLAAA or https://www.amazon.com/Samsung-SmartThings-Water-Sensor-GP-U999SJVLCAA/dp/B07F951JDP do report "battery_percentage_remaining" see https://community.home-assistant.io/t/zha-zigbee-tested-devices-please-add-your-device-results/17718/431?u=quatuor and some probably not.
Centralite Motion "Iris" sensors do not report "battery_percentage_remaining". The problem I see with reporting the battery % remaining based on battery voltage means that we either need to assume that all sensors have 3v batteries, which might not be always the case, like in https://www.sinopetech.com/en/boutique/all-products/smart-water-valve-3-4-in/ or create battery sensor based on model&manufacturer but in this case you maybe better going with "battery % remaining" attribute if the device supports it or implement it using zigpy quirks. Implementing it through zigpy quirks is pretty much equivalent to implementing battery sensor based on manufacturer/model, just moves abstraction layer to zigpy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have the new smartthings sensors? I have the older variety of both the multipurpose and the water sensor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it makes sense to use battery percentage if each sensor varies with the voltage, and use a quirk to implement it if its missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I'm going to try and create a smartthings quirk based on your example to write the percentage battery attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented the quirk from your example above, but haven't had any luck getting a battery level reported, just get "Unknown".