Skip to content

ESPHome Fix intermediary state published#27638

Merged
pvizeli merged 1 commit into
home-assistant:devfrom
OttoWinter:esphome-fix-intermediary-state
Oct 14, 2019
Merged

ESPHome Fix intermediary state published#27638
pvizeli merged 1 commit into
home-assistant:devfrom
OttoWinter:esphome-fix-intermediary-state

Conversation

@OttoWinter
Copy link
Copy Markdown
Member

Fixes esphome/issues#426

Description:

There was an issue with ESPHome entities where they would publish old states when coming back online because of some internal mechanics.

Scenario:

  1. Device powers up, sends state 23.0 to HA - HA creates entity with state 23.0
  2. Device powers down, HA sees this and sets availability to false. State: unavailable.
  3. Device powers up again, HA sees this again and sets availability on all entities to true again. A state update is scheduled and the old state of 23.0 is published
  4. A few milliseconds later, the device reports the new state of 18.0. HA state update: 18.0

This PR basically disables the state update scheduling in step 3. In hindsight, it's an oversight in the communication protocol that the initial state is not sent together in the packet with the entity info, but now it can't be changed that easily.

Related issue (if applicable): fixes #

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

Example entry for configuration.yaml (if applicable):

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.
  • I have followed the development checklist

Comment thread homeassistant/components/esphome/__init__.py
@pvizeli pvizeli merged commit a79a980 into home-assistant:dev Oct 14, 2019
@lock lock Bot locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

homeassistant binary sensor toggles on home assistant restart

3 participants