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
69.74k stars 28.9k forks source link

You cannot control lights by voice (Assist or Alexa) when the status in Home Assistant is incorrect. #118892

Open jlipsit opened 4 weeks ago

jlipsit commented 4 weeks ago

Update: problem may not be with the Amazon Alexa skill since the same problem occurs with Assist. (See below Screen Snapshot)

The problem

Issue: The Amazon Alexa skill and Assist ,fails to turn off lights if the status in Home Assistant is incorrect.

Description: If the status of a light is listed as OFF in Home Assistant but the light is actually turned on, asking Alexa or Assist to turn OFF the light results in Alexa / Assist saying "OK" and sending a command to turn off the light. However, the light does not turn off.

The only workaround is to ask Alexa / Assist to first turn ON the light and then ask her again to turn OFF the light. This is extremely frustrating, especially in scenarios where you are in bed after reading a book to the kids and want to turn off the light.

This issue is common because most modern wireless technologies (Zwave, Zigbee, Wi-Fi, Insteon, UPB, KNX) switches send their status to the controller when the light switch is controlled locally at the wall. When people enter a room and turn on multiple switches simultaneously, the status within Home Assistant is sometimes incorrect due to collisions or interference.

Apparently, there is a bug or rule in Home Assistant where if Alexa / Assist sends an OFF command and the switch/light is already OFF, nothing happens. In reality, the light is on and doesn't switch off.

Expected Behavior: Home Assistant should always send the ON or OFF command regardless of the current status in Home Assistant. This behavior is consistent with other home automation systems.

Steps to Reproduce:

  1. Ensure a light is listed as OFF in Home Assistant.
  2. Turn on the light manually using the switch when the status is not updated to ON.
  3. Ask Alexa to turn OFF the light.
  4. Observe that Alexa says "OK" but the light remains on.

Workaround: Ask Alexa or Assist to turn ON the light first, then ask her to turn OFF the light. Impact: This issue significantly affects usability, particularly when trying to control lights from bed or in similar convenience scenarios.

The solution is straightforward; just send the ON or OFF command to the device regardless of state,

Additional Information: I hope this simple change can be implemented to ensure Alexa and Assist always sends the ON or OFF command, regardless of the current status in Home Assistant.

Please unmute and watch to the included video:

https://github.com/home-assistant/core/assets/155367039/4dfc984d-2b63-4eb7-86e6-a774503a08e2

Same problem happens with Assist - in this example I had to have assist turn on the light, before I could turn it off by voice. (Again when the status is incorrect. The solution is straightforward; just send the ON or OFF command to the device regardless of state, Screenshot 2024-06-07 at 11 33 33 AM (002)

What version of Home Assistant Core has the issue?

2024.6.0

What was the last working version of Home Assistant Core?

None

What type of installation are you running?

Home Assistant OS

Integration causing the issue

alexa

Link to integration documentation on our website

https://www.nabucasa.com/config/amazon_alexa/

Diagnostics information

How do I get this for Amazon Alexa Skill?

Example YAML snippet

No response

Anything in the logs that might be useful for us?

I did not find any logs for Alexa Communication.

Additional information

• Core: 2024.6.0 • Supervisor: 2024.05.1 • Operating System: 12.3 • Frontend: 20240501.1

balloob commented 3 weeks ago

Don't tag people. Issues are handled as we process the queue.