Skip to content

Add more AC controls: HVAC mode and fan mode - #6

Merged
konradk merged 5 commits into
konradk:mainfrom
manuelseeger:more-ac-controls
Aug 17, 2026
Merged

Add more AC controls: HVAC mode and fan mode#6
konradk merged 5 commits into
konradk:mainfrom
manuelseeger:more-ac-controls

Conversation

@manuelseeger

Copy link
Copy Markdown
Contributor

Added generic Home Assistant climate controls:

  • Fan mode selector
    • Uses advertised fan_modes and current fan_mode.
    • Calls standard climate.set_fan_mode.
    • Enabled only when the entity has the HA FAN_MODE feature bit and valid advertised modes.
  • HVAC mode selector
    • Uses advertised hvac_modes; the entity state is the selected mode.
    • Calls standard climate.set_hvac_mode.
    • Supports modes such as cool, heat, dry, fan_only, auto, and off exactly as advertised.

Home assistant knows more controls like fan swing, presets, target humidity, and more. I did not add these to not overload the HVAC widget.

@konradk

konradk commented Aug 16, 2026

Copy link
Copy Markdown
Owner

@manuelseeger Thank you for your PR! This fixes the issue reported here, as my fix turned out to be incomplete.

Few comments:

screenshot-2026-08-16_21-41-02
  1. I think it would be better to use the omarchy's dropdown component, instead of listing all the options as a button.
  2. Option labels are capitalized raw values:
options: control.fanModes.map(function(mode) {
            return { value: mode, label: Model.capitalize(mode) }
})

so we have buttons with labels like "Fan_only". I think we should have dedicated function in Model to convert values to visible lables, like:

function climateHvacModeLabel(mode) {
  switch (mode) {
  case "off": return "Off"
  case "heat": return "Heat"
  case "cool": return "Cool"
  case "heat_cool": return "Heat/Cool"
  case "auto": return "Auto"
  case "dry": return "Dry"
  case "fan_only": return "Fan only"
  default: return humanizeMode(mode)
  }
}

Let me know what you think and whether it's possible to implement corrections to the PR, I'd be happy to merge it.

@konradk konradk mentioned this pull request Aug 16, 2026
@manuelseeger

manuelseeger commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

All good suggestions!

I turned the controls into Omarchy dropdowns. That gives the panel a lot more real estate so I added the Presets and Swing controls from HA's HVAC protocol.

A few notes:

  • I wanted everything accessible by keyboard to align with Omarchy philosophy, which required an expansion in the cursor movement logic
  • The standard Omarchy Dropdown renders rich text. An edge case, but in theory a HA server could send HTML and trigger a network request from a label. Not addressed in this change yet. I could add a sanitizer for the labels.
image

@konradk

konradk commented Aug 17, 2026

Copy link
Copy Markdown
Owner

@manuelseeger Thank you for your fixes! Looks great. I will merge this PR.

Your comment about the dropdown is valid, but maybe it should be reported to the omarchy repo? I don't think it's intentional for this field as qt docs recommends using plaintext for untrusted content.

@konradk
konradk merged commit bd50420 into konradk:main Aug 17, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants