Skip to content
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

Add storage helper to ZHA and use it for the device node descriptor #21500

Merged
merged 8 commits into from Mar 4, 2019

Conversation

Projects
None yet
5 participants
@dmulcahey
Copy link
Contributor

commented Feb 27, 2019

This PR adds storage to ZHA and leverages it for storing the zigbee node descriptor so that we have the device specific power profile and the manufacturer code available for us to use. Eventually it will house the group id's and tables for multicast transmissions (real zigbee light groups) and the neighbor and rousing tables that we can use for network visualization among other things.

@balloob looking for your feedback on the storage usage if you don't mind... want to make sure I did this correctly.

@balloob
Copy link
Member

left a comment

looks fine

@dmulcahey dmulcahey force-pushed the dmulcahey:dm/zha-node-power-descriptors branch 2 times, most recently from 438dda5 to fc5cf60 Feb 28, 2019

@dmulcahey

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

@balloob are we good when the build passes?

@dmulcahey dmulcahey requested a review from balloob Mar 2, 2019

dmulcahey added some commits Feb 24, 2019

node descriptor implementation
add info to device info

disable pylint rule

check for success

@dmulcahey dmulcahey force-pushed the dmulcahey:dm/zha-node-power-descriptors branch from fc5cf60 to c7c7fec Mar 3, 2019

dmulcahey added some commits Mar 3, 2019

@roblandry roblandry referenced this pull request Mar 3, 2019

Merged

Add SmartThingsAccelCluster to ZHA binary_sensor #21609

3 of 3 tasks complete

@balloob balloob merged commit fc07d3a into home-assistant:dev Mar 4, 2019

4 checks passed

Hound No violations found. Woof!
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.004%) to 92.747%
Details

@ghost ghost removed the in progress label Mar 4, 2019

mxworm added a commit to mxworm/home-assistant that referenced this pull request Mar 4, 2019

Merge branch 'dev' into current
* dev: (344 commits)
  Better output of workflow
  Upgrade youtube_dl to 2019.03.01 (home-assistant#21647)
  GitHub Workflow (home-assistant#21643)
  Fix actions with tox (home-assistant#21642)
  Replace travis (home-assistant#21641)
  Allow configuration of update interval for ness_alarm (home-assistant#21415)
  Updated frontend to 20190303.0
  Update translations
  Add storage helper to ZHA and use it for the device node descriptor (home-assistant#21500)
  Log exception occurred in WS service call command (home-assistant#21584)
  Fix calc next (home-assistant#21630)
  Expose create/delete cloudhook (home-assistant#21606)
  Return Netatmo climate operation_mode instead of boiler status (home-assistant#21633)
  Bump pyflunearyou to 1.0.3 (home-assistant#21634)
  fix derived rate, fixes home-assistant#20097 (home-assistant#21620)
  Add optional sender name for SendGrid (home-assistant#21610)
  Add 'app_name' property and 'apps' config entry to Fire TV (home-assistant#21601)
  Add device HMIP-eTRV-C to HomematicIP (home-assistant#21612)
  Bumping aioasuswrt (home-assistant#21627)
  SmartThings remove SmartApp/Automation on integration removal (home-assistant#21594)
  ...

@balloob balloob referenced this pull request Mar 20, 2019

Merged

0.90.0 #22216

@dmulcahey dmulcahey deleted the dmulcahey:dm/zha-node-power-descriptors branch May 8, 2019

@ckpt-martin

This comment has been minimized.

Copy link

commented Jun 26, 2019

Hi @dmulcahey,
Since the addition of the storage helper my ZigBee USB stick no longer works with ZHA. It works fine up to 0.89.2. But as soon as I upgrade to any 0.9x release Zigbee stops working with an error related to store.py. It looks like it is having an issue accessing or storing the power_source and manufacturer code of my stick.
I use the Bitronvideo AV2010/10 (http://bvsite.smabit.eu/index.php/produkte/smart-home-produkte/zb-funkstick/ - site is in German bit the specs are there).
This is the error that HA throws when starting:

2019-06-25 15:54:38 INFO (MainThread) [homeassistant.setup] Setting up zha
2019-06-25 15:54:38 INFO (MainThread) [homeassistant.setup] Setup of domain zha took 0.0 seconds.
2019-06-25 15:54:38 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry /dev/ttyUSB0 for zha
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config_entries.py", line 302, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/__init__.py", line 150, in async_setup_entry
    zha_storage = await async_get_registry(hass)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/core/store.py", line 160, in async_get_registry
    return cast(ZhaDeviceStorage, await task)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/core/store.py", line 155, in _load_reg
    await registry.async_load()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/core/store.py", line 112, in async_load
    power_source=device['power_source'],
KeyError: 'power_source'

I have went back to HA 0.89.2 where everything works. But I would like to upgrade HA at some point. Would be nice we could fix this. Thanks.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Jun 26, 2019

Please open an issue if you suspect a bug.

If you want to suggest an enhancement please open a feature request in the Feature Requests section of our community forum.

Merged PRs should not be used for enhancement discussion or bug reports. If you've found a bug it's ok to make a review with inline comments and link to an issue that reports the bug.

Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Jun 26, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.