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
74.13k stars 31.12k forks source link

Alexa: Covers unexpectedly open when controlling lights #31709

Closed Tho85 closed 4 years ago

Tho85 commented 4 years ago

The problem

When I add a cover to an Alexa smart home group, the cover inadvertently opens and closes when I try to control the lights (!) in that same Alexa smart home group.

Example:

My guess is that it has to do with #31265 where the PowerController was re-added to covers. Author @ochlocracy says that he

can't remember why it was removed :confused:

-- maybe this was the reason?

Environment

Problem-relevant configuration.yaml

alexa:
  smart_home:
    filter:
      exclude_domains:
        - binary_sensor
    locale: de-DE
    entity_config:
      cover.kuche_kuche:
        name: Rolladen Küche
homeassistant:
  customize:
    cover.kuche_kuche:
      device_class: shutter

Traceback/Error logs

-

Additional information

ochlocracy commented 4 years ago

Semantics "open", "close" "raise", "lower" currently only work in en-US and de-DE. Therefore "turn off" and "turn on" still need to be included for every other locale. That's why I was surprise I removed it at some point.

We will need to filter the PowerController for en-US and de-DE for covers that support semantics to resolve this.

I experience this with fans that yield the PowerController too when added to a room. The work around is to add the echo device to the Alexa group, and then use the utterance "Alexa, turn on the lights." (without the group name). That works for me to filter out the fans in a group.

probot-home-assistant[bot] commented 4 years ago

Hey there @home-assistant/cloud, mind taking a look at this issue as its been labeled with a integration (alexa) you are listed as a codeowner for? Thanks!

glassbase commented 4 years ago

That’s because of Alexa and not HA. As soon as you put items in a group and say turn on/off that group, it controls all items in that group regardless of the device type

I don’t have blinds but I guess Alexa considers open blinds as on.

Tho85 commented 4 years ago

Yes, I just discovered that the same happens with thermostats, so this is definitely an issue with how Alexa handles smart home groups.

However, for blinds this could be fixed in HA at least for English and German users, if HA doesn't export the PowerController for users with one of these locales.

ochlocracy commented 4 years ago

Only recently "open", "close" "raise", "lower" utterance have been added to the Alexa API. Before those utterances were added, yielding the PowerController was a work-around to control covers with "turn on" and "turn off" utterances.

While I believe removing the PowerController is the correct path for implementing cover utterances with Alexa. I'm still hesitant to submit the PR to resolve this until I can investigate the impact on covers that don't have supported_features of SUPPORT_SET_POSITION, SUPPORT_CLOSE, SUPPORT_OPEN in en-US and de-DE locales.

This may need to be postponed until Alexa semantics are supported in more locales.

Ultimately this would only resolve the issue with covers in an Alexa Group, but any device that yields a PowerController in the same group will have the same issue. e.g. Climate, Fans, Lights, Media Players, Switches, Vacuums.

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Tho85 commented 4 years ago

As pointed out, this is indeed an issue with the Alexa API, not HA. I'll close this, let's see how the Alexa API evolves.

bakerkj commented 4 years ago

I have run into this same problem.

Has there been any progress on the Alexa side on this?

Would it be possible to enable per device customization if a device yields a PowerController or not? Or alternatively make the behavior language dependent?

bakerkj commented 3 years ago

@Tho85 any thoughts on my above question?

Tho85 commented 3 years ago

The blind utterances are still not supported in all locales on the Alexa side (see here), so there's not much progress on that side. Hence, the alexa integration still yields a PowerController for blinds to work in all locales. So we're still out of luck, I guess.

The workaround for me is to have a cover in HA called "cover kitchen", so if I ask Alexa to "open the cover in the kitchen", it does as I say. The "cover kitchen" is not added to the Alexa "Kitchen" group, which I only use for my lights.

bakerkj commented 3 years ago

@Tho85 I have done something similar for my blinds setup. Is there a possibility that we could make it configurable per device if the integration yields a PowerController for a device? Or make it configurable if it yields a PowerController for any blinds?