Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Fan Mode error when switching HVAC mode #19620

Open
3 of 4 tasks
RobertD502 opened this issue Feb 2, 2024 · 8 comments
Open
3 of 4 tasks

Invalid Fan Mode error when switching HVAC mode #19620

RobertD502 opened this issue Feb 2, 2024 · 8 comments

Comments

@RobertD502
Copy link

RobertD502 commented Feb 2, 2024

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

When switching from an HVAC mode with a Fan speed (fan_mode) of Auto to a HVAC mode that only supports a fan speed of Auto, an error message pops up indicating Fan mode is not valid. Valid fan modes are: auto.

For example, if the climate entity is currently in HVAC mode Heat with a Fan mode of Auto, when switching to a HVAC mode that only supports a single Fan Mode (Auto), such as Dry or Heat/Cool in my case, the error pops up in the UI.

Video example shown below

Fan.mode.error.mov

Note: This behavior only happens when switching from a HVAC mode that supports multiple fan modes in addition to the Auto mode, but not when switching from a HVAC mode that only supports an Auto fan_mode to another HVAC mode that only supports an Auto fan_mode (i.e., Going from Dry mode with a Fan mode of Auto to a HVAC mode of Heat/Cool).

Related async_set_hvac_mode code below:

            if hvac_mode in [HVACMode.DRY, HVACMode.HEAT_COOL]:
                # When switching to Dry or Heat_Cool (Auto) mode,
                # a fan speed of Auto is expected

                mode_attributes = self.set_attributes('hvac_mode', mode, False)
                flair_speed = HASS_HVAC_FAN_SPEED_TO_FLAIR.get(FAN_AUTO)
                if self.hvac_data.attributes['fan-speed'] != flair_speed:
                    fan_attributes = self.set_attributes('fan_mode', flair_speed, False)
                    await self.coordinator.client.update('hvac-units', self.hvac_data.id, attributes=mode_attributes, relationships={})
                    await self.coordinator.client.update('hvac-units', self.hvac_data.id, attributes=fan_attributes, relationships={})
                    self.hvac_data.attributes['fan-speed'] = flair_speed
                else:
                    await self.coordinator.client.update('hvac-units', self.hvac_data.id, attributes=mode_attributes, relationships={})

                self.hvac_data.attributes['mode'] = mode
                self.async_write_ha_state()
                await self.coordinator.async_request_refresh()
                return None

As you can see, I am not setting self.hvac_data.attributes['fan-speed'] to flair_speed (which results in the fan_mode property returning the Home Assistant FAN_AUTO constant) prior to writing the HA state when the current fan mode is already Auto.

During my debugging of the error, I have identified that the Climate fan_mode property is correctly returning auto prior to calling self.async_write_ha_state(), after calling self.async_write_ha_state(), and after a refresh is requested from the coordinator. With all of this said, the error seems to be contradicting the actual state of the fan_mode property.

Describe the behavior you expected

When switching from an HVAC mode (which supports multiple fan modes) with a fan mode of Auto, to a HVAC mode that only supports a fan mode of Auto, no error message should be presented.

Steps to reproduce the issue

  1. Start with climate entity in a HVAC mode that supports multiple fan modes (auto, high, medium, low).
  2. Ensure the climate entity has a current fan mode of Auto.
  3. Change the HVAC mode to a HVAC mode that only supports Auto as its fan mode.
    ...

What version of Home Assistant Core has the issue?

2024.2.0b2

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

No response

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

image

@ChristophCaina
Copy link

I have similar issues with my Thermostats when i Change between "Auto", "heating" and "Off"...

@ChristophCaina
Copy link

Also, it appears the Same when I select the Program in my Coffee machine...

Copy link

github-actions bot commented Jul 7, 2024

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 has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 7, 2024
@RobertD502
Copy link
Author

Still an issue in the latest 20240705.0 frontend.

@github-actions github-actions bot removed the stale label Jul 7, 2024
@karwosts
Copy link
Contributor

karwosts commented Jul 8, 2024

I'm able to reproduce a similar effect by messing in developer tools. E.g. load up the climate.ecobee more-info from the demo integration.

Has the following fan modes, with default set to on_high

fan_modes:
  - on_low
  - on_high
  - auto_low
  - auto_high
  - "off"

While the more info is open, in developer tools in a separate window change the attribute fan modes to this:

fan_modes:
  - on_high

The fan mode control becomes bugged and it sends the invalid service call.

I guess the dropdown does not like it when it is selected to a particular index, and then the number of options changes to be less than that index, it resets the control to undefined and triggers a spurious service call. Same with any of the other dropdowns.

Copy link

github-actions bot commented Oct 6, 2024

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 has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 6, 2024
@RobertD502
Copy link
Author

Bump

@nchieffo
Copy link

nchieffo commented Oct 21, 2024

I'm also affected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants