home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

Mqtt switch reverts state in lovelace but not old gui, need to refresh #18226

Closed MatthewFlamm closed 5 years ago

MatthewFlamm commented 5 years ago

Home Assistant release with the issue: using 0.81.4 and 0.81.6

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): venv on raspbian

Component/platform: Discovered mqtt switch.

Description of problem: I am using esphomeyaml to create a switch on an esp32. It is discovered by home assistant and I can use the switch to turn on and off the chosen gpio pin as confirmed by an led. This works flawlessly on the old gui. The state updates to the correct value after switching.

On lovelace, the switch state reverts back to the original state, not the true state, and doesn't update to the true state until the page is refreshed. Once the page is refreshed, it works like it should. If the user presses the switch before refreshing, confusing things happen.

I suspect this is on the home assistant side, but I can raise this with esphomeyaml repo if needed.

Tested this on the chrome browser on android

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

mqtt:
  discovery: true
bachya commented 5 years ago

I had the same experience and stayed at 0.81.2. To really test, I recommend you upgrade to 0.81.6 and see if the problem still persists.

MatthewFlamm commented 5 years ago

Thanks for the suggestion, still happens in 0.81.6, updated the issue

MatthewFlamm commented 5 years ago

Should this have been posted in the home-assistant-polymer repository? It wasn't clear to me where lovelace was located within the structure at first.

bachya commented 5 years ago

I’d recommend you post an issue there, reference this one, and then once you’ve received, close the one that is in the wing place.