[codex] Add climate action and status telemetry#172
Open
joeblack2k wants to merge 1 commit into
Open
Conversation
This was referenced Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This draft PR combines three small status/telemetry fixes for the ESPHome LG controller:
actionfrom the live LG status frame.This supersedes #171. It ports the climate-action work onto a clean branch from
JanM321/mainand also addresses the #171 review comment about the preheat flag.Root Cause / Fix Log
#94 Climate action
The component previously restored and published HVAC mode, but did not advertise or update
CLIMATE_SUPPORTS_ACTION, so Home Assistant could only show the configured mode instead of the live action.This PR now:
CLIMATE_SUPPORTS_ACTIONto the climate traits.this->actionforoff,idle,cooling,drying,heating,fan, anddefrosting.preheatas idle for the indoor unit, which matters on multi-split systems where the outdoor unit can run for another indoor unit.0x40cooling,0x80heating) when the mode isheat_cool.Mapping:
mode == off->offdefrostbit set ->defrostingmode == fan_only->fanidlecool+ outdoor active ->coolingdry+ outdoor active ->dryingheat+ outdoor active ->heatingheat_cool+ status flags ->cooling/heating, otherwiseidle#132 Error code formatting
The LG error byte was already published raw, but the sensor schema did not specify integer-style precision. This PR keeps publishing the same raw LG byte and adds
accuracy_decimals: 0without assigning a device class or state class that Home Assistant might misinterpret.AE.80 / CE.80 telemetry
The protocol notes document additional type-6 subtype-0x80 telemetry frames. This PR passively parses those frames and exposes optional sensors:
humidity: byte 2,%, humidity device class, measurement, 0 decimals.fan_operation_time: bytes 3-4,h, duration device class, total_increasing, 0 decimals.indoor_unit_operation_time: bytes 6-7,h, duration device class, total_increasing, 0 decimals.precise_room_temperature: bytes 10-11 as integer + one decimal digit,°C, temperature device class, measurement, 1 decimal.Frames are ignored for
Slavesender messages and accepted only when subtype byte 1 is0x80. The precise room temperature is kept as a separate sensor and does not overwritecurrent_temperature.Validation
Repository validation:
git diff --checkpassed.uvx esphome config template.yamlpassed using a temporary/tmpcopy with a valid base64 API key substituted for the upstream placeholdermy_key.uvx esphome compile template.yamlpassed using the same temporary copy.Live Bioscoop LG Airco validation:
uvx esphome config bioscoop-lg-airco.yamlpassed.Legacy, static IP192.168.2.166, ESPHome API encryption, and passive/continuous BLE tracking with Bluetooth proxy inactive for Bermuda use./tmpbuild directory.192.168.2.166succeeded.2026-06-01 07:29:03 +0200, WiFi connected toLegacy, BLE tracker running, API reconnect successful.hvac_actionis now present. During live cooling test before the preheat refinement HA reportedhvac_action: cooling; after the final preheat-aware flash the current unit state wasoffwithhvac_action: off.unknownduring the short live log window because this unit did not emit a CE.80/AE.80 frame in that sample.Error Code >> 0with the generated code settingerror_code->set_accuracy_decimals(0). HA's backend state API still stores the value as a numeric string (0.0), which appears to be HA/ESPHome sensor state representation rather than a firmware precision issue.Known Limitation
The AE.80/CE.80 sensors are passive. They only publish values when the LG bus actually emits a matching type-6 subtype-0x80 frame.