This commit is contained in:
choibk 2025-11-14 11:07:45 +09:00
parent facb4f2a49
commit e32ef69391
2 changed files with 20 additions and 3 deletions

View File

@ -1,9 +1,10 @@
#### House Control
##### Version == R 1.0.23
##### Version == R 1.0.24
1. OTA
* https://esp32.qmsguide.synology.me
* /housecontrol.txt
* .bin 파일 위치 == .pio/build/esp32dev/firmware.bin
2. 태양광 발전 및 LED 전등 제어
- 태양광 발전량 모니터링
@ -49,3 +50,9 @@
(Relay 2 는 Realy 1 과 항상 동기)
- 31 / 30 == Relay 3 ON / OFF
- 100 == OTA Update Command
##### Version History
###### R 1.0.24
* 수정
* 온습도 MQTT 발행 누락 수정

View File

@ -16,7 +16,7 @@
#include "esp_sleep.h"
#include "esp_wifi.h" // esp_wifi_set_ps
#define CURRENT_VERSION "R_1_0_23"
#define CURRENT_VERSION "R_1_0_24"
// ---------- Low Power ----------
#define LOW_POWER_MODE 1
@ -567,6 +567,9 @@ static inline void i2c_error_report_1s() {
/* ----------------------------- Publish Status ----------------------------- */
void publishStatus() {
// ★ MD04 온습도 최신값 폴링 (내부에서 주기 제한: MD04_POLL_MS)
md04_poll_if_due();
// I2C 상태 점검 & 복구
if (millis() - lastI2cCheckMs > 2000) {
lastI2cCheckMs = millis();
@ -690,6 +693,13 @@ void publishStatus() {
doc["dwh1"] = roundf(dailyWh1 * 10000) / 10000.0f;
doc["dwh2"] = roundf(dailyWh2 * 10000) / 10000.0f;
// ★ MD04 온습도 (소수 1자리로 반올림)
if (isfinite(md04_airT)) doc["airT"] = roundf(md04_airT * 10) / 10.0f;
else doc["airT"] = nullptr;
if (isfinite(md04_airH)) doc["airH"] = roundf(md04_airH * 10) / 10.0f;
else doc["airH"] = nullptr;
char buffer[768];
size_t len = serializeJson(doc, buffer);
digitalWrite(LED_TX, HIGH);