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

Restore zha binary_sensors state on hass restart #19314

Merged
merged 1 commit into from Dec 22, 2018

Conversation

Projects
None yet
5 participants
@Adminiuga
Copy link
Contributor

Adminiuga commented Dec 15, 2018

Description:

This addresses issues of ZHA binary devices displaying incorrect state after hass restart until the device in question is triggered again like in #17821

The restore state is a fallback mechanism, as ZHA entity would try to reach to the device and query its current state via async_update() if it fails, then restore the state if available.

Related issue (if applicable): fixes #17821

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
Restore state for zha binary_sensors on restart.
Poll zha devices for current status, if not available restore state.
@Adminiuga

This comment has been minimized.

Copy link
Contributor

Adminiuga commented Dec 19, 2018

rerunning Travis...

@Adminiuga Adminiuga closed this Dec 19, 2018

@wafflebot wafflebot bot removed the in progress label Dec 19, 2018

@Adminiuga Adminiuga reopened this Dec 19, 2018

@wafflebot wafflebot bot added the in progress label Dec 19, 2018

@MartinHjelmare MartinHjelmare changed the title Restore state for zha binary_sensors on hass restart. Restore zha binary_sensors state on hass restart Dec 22, 2018

@MartinHjelmare MartinHjelmare merged commit 54c57fe into home-assistant:dev Dec 22, 2018

5 checks passed

Hound No violations found. Woof!
WIP Legacy commit status override — see details
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.2%) to 93.041%
Details

@wafflebot wafflebot bot removed the in progress label Dec 22, 2018

@Photo64

This comment has been minimized.

Copy link

Photo64 commented Dec 22, 2018

hmmm, seems odd that #17821 was closed and this was merged when it didn't seem to work for me. Was there another update made that I can try?

mxworm added a commit to mxworm/home-assistant that referenced this pull request Dec 22, 2018

Merge branch 'dev' into current
* dev: (22 commits)
  Update yale smart alarm client to v0.1.6 (home-assistant#19495)
  Add deprecation warning (home-assistant#19515)
  Restore state for zha binary_sensors on restart. (home-assistant#19314)
  Add ZHA battery sensor (home-assistant#19363)
  Clean up RFLink tests and add two tests (home-assistant#19511)
  Allow scrape sensor to retry setting up platform if initial setup fails (home-assistant#19498)
  Add Lutron Homeworks component (home-assistant#18311)
  Disable creating port mappings from UI, add discovery from component (home-assistant#18565)
  Bumped version to 0.84.6
  Remove check if base url is local (home-assistant#19494)
  Remove check if base url is local (home-assistant#19494)
  Bumped version to 0.84.5
  Bump pyharmony (home-assistant#19460)
  Bumped version to 0.84.4
  Use web sockets for Harmony HUB (home-assistant#19440)
  Fix IHC config schema (home-assistant#19415)
  Updated frontend to 20181211.2
  Bumped version to 0.84.3
  Fix not being able to update entities (home-assistant#19344)
  Fix restore state for manual alarm control panel (home-assistant#19284)
  ...
@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 22, 2018

What do you mean? We close issues when the PR that should fix them is merged. This PR isn't released yet. Did you apply it manually and it didn't work?

@Photo64

This comment has been minimized.

Copy link

Photo64 commented Dec 22, 2018

Yes, if you check out my comments in #17821, I manually applied the updated homeassistant/components/binary_sensor/zha.py file, manually opened and closed the door so the sensor was set back to "closed" however when I restarted hass the sensor upon restart showed as "open" even though the door was closed. So this updated file did not work for me.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Dec 22, 2018

Ok, we should continue following this in the issue.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Dec 22, 2018

@Adminiuga Adminiuga deleted the Adminiuga:zha-binary-restore-state branch Dec 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.