Skip to content

Show external temperature/humidity on the display - #202

Open
altoing wants to merge 2 commits into
devbis:masterfrom
altoing:feature/external-display-values
Open

altoing wants to merge 2 commits into
devbis:masterfrom
altoing:feature/external-display-values

Conversation

@altoing

@altoing altoing commented Sep 29, 2026

Copy link
Copy Markdown

This lets the LCD show values pushed from outside instead of the local sensor, e.g. the readings of a weather station or another sensor, while the device itself keeps reporting its own measurements.

How it works

  • Two new attributes in Thermostat UI Configuration (0x0204): 0x0200 external temperature (int16, 0.01 °C) and 0x0201 external humidity (uint16, 0.01 %).
  • Writing either one refreshes the LCD right away. Reporting is unchanged: the device still reports its own sensor.
  • If nothing is written for 30 min, the display falls back to the local sensor, so a dead HA or an offline source never leaves stale numbers on the screen. The age is counted in the 10 s sensor timer because clock_time() wraps every ~268 s.
  • The comfort smiley and °F mode use the shown values.

Backward compatibility

  • The values are RAM-only and not part of zcl_nv_thermostatUiCfg_t, so the saved settings layout doesn't change and existing settings survive the OTA.
  • A device that never gets a write behaves exactly as before.
  • converters/lywsd03mmc.js gets two new settings, external_temperature and external_humidity. The README documents the attributes.

Testing
This has been running on a real LYWSD03MMC as a patch on top of 1.1.0 (SDK 3.6.8.6), updated over OTA from Zigbee2MQTT and fed every 10 min by a Home Assistant automation. I tested the push, the immediate refresh, and a battery change. This branch is the same change on current master. It builds with the repo Dockerfile (SDK 3.7.2.0), but I haven't flashed that exact build.

This builds on #201 because both change the humidity display line. Please merge that one first, or I can rebase this one if you'd rather take only this one.

altoing and others added 2 commits September 29, 2026 10:41
…g leading zero at x.9

- Below -9.9 °C (or °F) the value does not fit the big number with a
  decimal point, so show_big_number() returned early and the LCD kept
  the last value. Show whole degrees instead (e.g. -15).
- At 100 % humidity show_small_number() returned early for the same
  reason. Cap the shown value at 99.
- 0.9 was shown as ".9": the leading zero was only added below 9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two new RAM-only attributes in Thermostat UI Configuration (0x0204):
0x0200 external temperature (int16, 0.01 ºC) and 0x0201 external
humidity (uint16, 0.01 %). Writing them makes the LCD show these values
instead of the local sensor, e.g. readings from an outdoor weather
station. The device keeps reporting its own measurements.

- The display refreshes right after the write.
- After 30 min without a write the display falls back to the local
  sensor. The age is counted in the sensor timer because clock_time()
  wraps every ~268 s.
- The values are not in the NV struct, so the saved settings layout is
  unchanged and nothing changes for devices that never get a write.
- Comfort smiley and ºF mode use the shown values.
- converters/lywsd03mmc.js exposes both as external_temperature and
  external_humidity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant