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

Fan control interface does not display options correctly #226

Open
Masy opened this issue Oct 10, 2024 · 7 comments
Open

Fan control interface does not display options correctly #226

Masy opened this issue Oct 10, 2024 · 7 comments

Comments

@Masy
Copy link

Masy commented Oct 10, 2024

I'm currently developing a stick that can control midea AC units, and i stumbled upon a weird behavior when exposing a fan control cluster:

6.4.2.2.2 of the zigbee cluster specification states that the fan mode sequence attribute should be set to 0x02 if the fan supports low/med/high/auto modes.
grafik

This does seem to be picked up correctly by home assistant / ZHA:
grafik

However, in the interface, the only options are 'on' and 'auto', which corresponds to 0x04:
grafik

@Masy
Copy link
Author

Masy commented Oct 10, 2024

I noticed the thermostat isn't displayed correctly as well. I set the ControlSequenceOfOperation to 0x04, which should display all possible modes of SystemMode.
grafik
grafik

The only displayed modes for me are off, cool, heat and auto. If i manually set the SystemMode to dry when initializing the zigbee device on the ESP32C6 it is displayed in HA, but i can't set it via the interface.
grafik

@puddly
Copy link
Contributor

puddly commented Oct 10, 2024

HVAC operations are sort of split up between climate modes, default climate presets, and custom climate presets. We map them to one of the supported Home Assistant climate modes here and create presets on a thermostat-by-thermostat basis:

SEQ_OF_OPERATION = {
ControlSequenceOfOperation.Cooling_Only: [HVACMode.OFF, HVACMode.COOL],
ControlSequenceOfOperation.Cooling_With_Reheat: [HVACMode.OFF, HVACMode.COOL],
ControlSequenceOfOperation.Heating_Only: [HVACMode.OFF, HVACMode.HEAT],
ControlSequenceOfOperation.Heating_With_Reheat: [HVACMode.OFF, HVACMode.HEAT],
ControlSequenceOfOperation.Cooling_and_Heating: [
HVACMode.OFF,
HVACMode.HEAT_COOL,
HVACMode.COOL,
HVACMode.HEAT,
],
ControlSequenceOfOperation.Cooling_and_Heating_with_Reheat: [
HVACMode.OFF,
HVACMode.HEAT_COOL,
HVACMode.COOL,
HVACMode.HEAT,
],
0x06: [HVACMode.COOL, HVACMode.HEAT, HVACMode.OFF], # centralite specific
0x07: [HVACMode.HEAT_COOL, HVACMode.OFF], # centralite specific
}
.

I think for this attribute to work, the various modes from the ZCL would need to be turned into custom presets.

Does your device actually support all of the ZCL modes? If not, which ones does it support?

@Masy
Copy link
Author

Masy commented Oct 11, 2024

the only thing im unsure about is if the eco mode corresponds to precooling, but i guess it supports all modes of the zigbee standard mentioned in table 6-16

@Masy
Copy link
Author

Masy commented Oct 12, 2024

so my understanding is that precooling basically saves energy by pre-cooling air in the morning so the building can be cooled more efficiently during hotter parts of the day. in contrast, eco mode just runs the compressor with less power. so technically they are not the same, although both are aimed at reducing energy cost.

however, since the zigbee standard does not support an eco mode, i would use the precooling mode as eco mode for my use case.

i'm not sure whats the best solution here, but i would at least support emergency heat, fan only, dry and sleep for climate devices

@puddly
Copy link
Contributor

puddly commented Oct 12, 2024

We can display the modes (the draft PR I'm working on above does this) but it may have to be gated behind a quirk, depending on device support. It's a little frustrating that the spec makes some of these modes all-or-nothing, without allowing any sort of support bitfield.

I'll have to look at how other thermostats report their capabilities.

@Masy
Copy link
Author

Masy commented Oct 12, 2024

its funny how the zigbee standard states that not all SystemMode / ControlSequenceOfOperation values have to be supported, yet doesn't offer a way to report which are

@Masy
Copy link
Author

Masy commented Oct 15, 2024

would it be possible to just add the missing modes to the SEQ_OF_OPERATION array for now?
I need to be able to select these modes to properly develop the firmware for the stick.
Otherwise i would fork ZHA and do it myself until its properly fixed, but that would make things complicated because i have to install a custom version of the integration

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

2 participants