Repository navigation
Docs: keep the temperature source after an ESP restart (YAML snippet) - #24
Merged
samphonic merged 2 commits intoNov 29, 2026
Merged
Conversation
…(YAML snippet) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
keithajmani
force-pushed
the
restore-temp-after-restart-snippet
branch
from
November 28, 2026 21:43
ec7af91 to
e78d8df
Compare
samphonic
reviewed
Nov 28, 2026
samphonic
left a comment
Contributor
There was a problem hiding this comment.
Just one minor adjustment on the docs and I'll merge this (couldn't quickly do this myself in codespace because it denied me permission to push change-- not sure if that's on me or not)
| After an ESP restart there is no temperature to send until the source reports again. See | ||
| [After an ESP restart](infrequent-sensors.md#after-an-esp-restart). | ||
| ::: | ||
|
|
Contributor
There was a problem hiding this comment.
Replace lines 14-20 with:
component enforces that check. Some units revert much sooner (around a minute), which can cause unexpected timeouts even during an ESP32 reboot/update; see
[Dealing with Infrequent Sensor Updates](infrequent-sensors.md).
:::
(tried to do this myself but don't have permissions to push change to this fork)
…eview suggestion) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Done, thanks! Applied your suggested wording and removed the separate tip. |
Contributor
|
Thanks for the contribution! |
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.
Written by Claude (Anthropic's AI assistant) for me. I've reviewed it.
After an ESP restart there's no remote temperature to send until the selected source reports again: about a minute for an MHK2, longer for a HA sensor that only pushes on change. Units that revert quickly fall back to their internal sensor in the meantime, and if that sensor is somewhere cold they start an unneeded heat run.
This adds an "After an ESP restart" section to Dealing with Infrequent Sensor Updates, as Sam suggested on Discord. It's a short YAML-only fix for a single source that works on current
main: arestore_valueglobal keeps the source's last temperature, and after boot awhileloop re-sends it withtemperature_source_report()every 5 s, until the source sensor has a state, for at most 3 min.It also adds a short tip on Adding Extra Temperature Sources that links to the new section.
How I tested it. I installed the snippet exactly as written on stock
main, on my PVA-A42AA7 / PUZ-HA42NKA1 with an MHK2 (ESP32-C3, ESPHome 2026.11.1). The unit was in Fan mode, with "Thermostat" selected and a device log capture running:temperature_source_report()every 5 s from +5.6 s. The MHK2 reconnected at +73 s. The unit reported 20.0 °C throughout and never reported its internal sensor, and the loop stopped by itself oncethermostat_temperaturehad a state.The snippet as written also compiles in a minimal config. Not tested: a real power cut, which relies on the periodic flash write instead of the sync at shutdown.
A built-in, opt-in alternative is proposed in muart-group/esphome-components#80, with its docs in #23. This snippet is useful either way, for anyone not running that version.