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
70.53k stars 29.45k forks source link

YoLink YS6802 Control Mapping Issue #118579

Open mandreko opened 2 months ago

mandreko commented 2 months ago

The problem

I purchased the YoLink YS6802 weatherproof smart plug for my outdoor fountain and lights. It has 2 electrical outlets on it. I added it to the YoLink app, and it's working as intended.

However, when I reloaded the YoLink HomeAssistant integration, it discovered the device but has mapped incorrect controls to it. Instead of 2 electrical outlets, it shows 4 electrical plugs, and a USB port. By triggering the switches in the YoLink app, I identified that the switch labeled "1" on the physical device ties to the "USB ports" switch in HA, and the "2" switch lines up with "Plug 1". Plugs 2-4 seemingly do nothing, but turn themselves off shortly after turning them on. image

I'm guessing this is probably just a weird mapping issue with this specific model in the code, but I'm really unsure. I started looking into the source, but my Python abilities are limited. I found the plug name definitions here https://github.com/home-assistant/core/blob/dev/homeassistant/components/yolink/strings.json#L46 but then wasn't sure where they were defined or how they were mapped to this specific model :( Maybe somewhere near here? https://github.com/home-assistant/core/blob/80e9ff672a7bbf706d8503b3a41ee1fefd958039/homeassistant/components/yolink/switch.py#L60-L94

What version of Home Assistant Core has the issue?

core-2024.5.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

YoLink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/yolink/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @matrixd2, mind taking a look at this issue as it has been labeled with an integration (yolink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `yolink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign yolink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


yolink documentation yolink source (message by IssueLinks)

matrixd2 commented 2 months ago

When adding support for this type of device, the API did not expose the device model, So the differences between models were not addressed.