home-assistant/core · warning · ValueError

Unsupported preset mode {preset_mode}

Error message

Unsupported preset mode {preset_mode}

What it means

Raised as ValueError by AprilaireClimateEntity.async_set_preset_mode when the requested preset is not one of the three hardcoded presets. Aprilaire maps presets directly to thermostat hold levels: PRESET_AWAY -> set_hold(3), PRESET_VACATION -> set_hold(4), PRESET_NONE -> set_hold(0); anything else has no hold level and is rejected.

Source

Thrown at homeassistant/components/aprilaire/climate.py:321

        mode_value = list(HVAC_MODE_MAP.keys())[mode_value_index]

        await self.coordinator.client.update_mode(mode_value)

        await self.coordinator.client.read_control()

    @override
    async def async_set_preset_mode(self, preset_mode: str) -> None:
        """Set the preset mode."""

        if preset_mode == PRESET_AWAY:
            await self.coordinator.client.set_hold(3)
        elif preset_mode == PRESET_VACATION:
            await self.coordinator.client.set_hold(4)
        elif preset_mode == PRESET_NONE:
            await self.coordinator.client.set_hold(0)
        else:
            raise ValueError(f"Unsupported preset mode {preset_mode}")

        await self.coordinator.client.read_scheduling()

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Use only the presets exposed by the entity's preset_mode/preset_modes attributes ('Away', 'Vacation', 'None').
  2. Map custom preset names to one of the three supported presets in the calling automation.
  3. Clear a preset with preset_mode 'None' rather than 'none'/'off' variants.

Example fix

# before
action:
  - action: climate.set_preset_mode
    target:
      entity_id: climate.aprilaire
    data:
      preset_mode: "eco"

# after
action:
  - action: climate.set_preset_mode
    target:
      entity_id: climate.aprilaire
    data:
      preset_mode: "away"
Defensive patterns

Strategy: type-guard

Validate before calling

SUPPORTED_PRESETS = {"Away", "Vacation", "None"}
if preset_mode not in SUPPORTED_PRESETS:
    return

Type guard

def is_aprilaire_preset(preset: str) -> bool:
    return preset in {"Away", "Vacation", "None"}

Try / catch

try:
    await climate_entity.async_set_preset_mode(preset_mode)
except ValueError:
    # unsupported preset; log and skip
raise

Prevention

When it happens

Trigger: A climate.set_preset_mode service call with a preset_mode other than 'Away', 'Vacation', or 'None' (the component's PRESET_AWAY/PRESET_VACATION/PRESET_NONE values) on an Aprilaire climate entity.

Common situations: Generic dashboards that list presets like 'Eco', 'Boost', 'Home' from other integrations; automations copied from a different thermostat; user-authored scripts assuming a common preset vocabulary across integrations.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/fced4aa268e3da8c. Report an issue: GitHub.