Skip to content

Target temperature 0.5°C decoded incorrectly when AC uses frac_bool flag #220

Description

@makkie2002

Describe the bug

When setting a target temperature with a 0.5 C step (e.g. 23.5 C), some AC models correctly accept and report back the half-degree via the target_temp_frac_bool flag (bit 7 of body byte 4), but leave target_temp_frac_dec (body byte 14) at 0. The current decode at aux_ac.h:1451 only reads target_temp_frac_dec / 10.0, discarding the information from target_temp_frac_bool. This causes the published target temperature to snap back to the integer value.

Evidence from logs

Setting 23.5 via HA, the AC response packet shows:

  • body[4] = 0x80 → target_temp_frac_bool = 1 (bit 7 set, confirms half-degree)
  • body[14] = 0x00 → target_temp_frac_dec = 0

Before the command: body[4] = 0x01 (frac_bool = 0). After: body[4] = 0x80 (frac_bool = 1). The AC confirms the 0.5 step, but the decode ignores the bool flag.

Fix

Replace the current code:

stateFloat = 8.0 + (float)(small_info_body->target_temp_int) + (small_info_body->target_temp_frac_dec / 10.0);

With:

stateFloat = 8.0 + (float)(small_info_body->target_temp_int) + (small_info_body->target_temp_frac_dec > 0 ? (small_info_body->target_temp_frac_dec / 10.0) : (small_info_body->target_temp_frac_bool ? 0.5 : 0.0));

This prefers the decimal field when populated (ACs that report 0.1-0.9) but falls back to the bool flag for ACs that only indicate 0.5 via the binary indicator.

Environment

  • Component version: 0.3.3
  • ESPHome: 2026.6.5
  • Tested on a non-inverter AUX-based AC (brand may vary)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions