home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.8k stars 2.6k forks source link

Tuya fan entity (Duux Whisper Flex) automatically starts oscillating when clicked wherever in the interface #21222

Open tozzke opened 1 week ago

tozzke commented 1 week ago

Checklist

Describe the issue you are experiencing

It's been a while since I used my fan (last september I think) but I just noticed this issue.

When I click on my (Tuya based) Duux Whisper Flex entity wherever in Home Assistant (whether it's on a dashboard, at the developer tools section or the Tuya integration page itself) the fan beeps and automatically starts oscillating. When I turn the oscillating to 'No' the fan stops oscillating, close the entity window and click the entity again, 'Oscillating' shows 'Yes', the fan beeps and starts oscillating again

Describe the behavior you expected

When clicked on the entity I just want to see the current settings and change settings manually when needed, I don't want it to change any settings automatically

Steps to reproduce the issue

  1. click entity that results in the default fan card

What version of Home Assistant Core has the issue?

2024.6.4

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Google Chrome 126.0.6478.127, Firefox 127.0.2

Which operating system are you using to run this browser?

Windows 11 Pro (10.0.22631 Build 22631), Android 14

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

karwosts commented 1 week ago

Guess entity attributes probably aren't correct.

Can you find your fan entity in devtools (when oscillating is off), and show the state attributes listed here?

e.g.:

image

tozzke commented 1 week ago

That attribute changes accordingly image

karwosts commented 1 week ago

That does explain it, it has a string "false" for oscillating, but we are expecting a boolean false, as per the fan docs: https://developers.home-assistant.io/docs/core/entity/fan/

In the frontend it is coded such that anything other than a boolean false for oscillating is interpreted as "on", and that causes the panel to think the on value has been selected.

I would report this to the Tuya core integration and point out the discrepancy between this attribute returning a string when it should be a boolean, that should get this fixed. Of couse the frontend could be made more robust to not call the turn on service on incorrectly behaving entities, but I'm not sure if that's a road we want to go down.