diff --git a/README.md b/README.md index eb32563..581bb6c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Custom firmware for Tuya [THB2](https://pvvx.github.io/THB2), [BTH01](https://pv | N | Описание | |---|--- | | 1.0 | Первая релизная версия | -| 1.1 | Добавлен триггер - вывод TX2 срабатывающий по установленным значениям температуры и/или влажности с гистерезисами. Передача состояния вывода RX2. Для термометров с экраном добавлен показ смайлика с "комфортом". | +| 1.1 | Добавлен триггер - вывод TX2 срабатывающий по установленным значениям температуры и/или влажности с гистерезисами. Передача состояния вывода RX2 при connect. Для термометров с экраном добавлен показ смайлика с "комфортом". | ## Прошивка: diff --git a/bin/BTH01_v11.bin b/bin/BTH01_v11.bin index 19a11e0..60089d2 100644 Binary files a/bin/BTH01_v11.bin and b/bin/BTH01_v11.bin differ diff --git a/bin/TH05_v11.bin b/bin/TH05_v11.bin index 9e34e74..3827e23 100644 Binary files a/bin/TH05_v11.bin and b/bin/TH05_v11.bin differ diff --git a/bin/THB2_v11.bin b/bin/THB2_v11.bin index ec4eac3..38cd1df 100644 Binary files a/bin/THB2_v11.bin and b/bin/THB2_v11.bin differ diff --git a/bthome_phy6222/bin/BTH01_v11.bin b/bthome_phy6222/bin/BTH01_v11.bin index 19a11e0..60089d2 100644 Binary files a/bthome_phy6222/bin/BTH01_v11.bin and b/bthome_phy6222/bin/BTH01_v11.bin differ diff --git a/bthome_phy6222/bin/TH05_v11.bin b/bthome_phy6222/bin/TH05_v11.bin index 9e34e74..3827e23 100644 Binary files a/bthome_phy6222/bin/TH05_v11.bin and b/bthome_phy6222/bin/TH05_v11.bin differ diff --git a/bthome_phy6222/bin/THB2_v11.bin b/bthome_phy6222/bin/THB2_v11.bin index ec4eac3..38cd1df 100644 Binary files a/bthome_phy6222/bin/THB2_v11.bin and b/bthome_phy6222/bin/THB2_v11.bin differ diff --git a/bthome_phy6222/source/sensor.h b/bthome_phy6222/source/sensor.h index bb3a9af..b6d52a9 100644 --- a/bthome_phy6222/source/sensor.h +++ b/bthome_phy6222/source/sensor.h @@ -149,7 +149,7 @@ typedef struct _measured_data_t { int16_t humi; // x 0.01 % uint16_t battery_mv; // mV uint8_t battery; // 0..100 % - uint8_t out_flg; // _measured_flg_t +// uint8_t out_flg; // _measured_flg_t measured_flg_t flg; } measured_data_t; #define send_len_measured_data 10 diff --git a/bthome_phy6222/source/trigger.c b/bthome_phy6222/source/trigger.c index d2dd482..bf88ace 100644 --- a/bthome_phy6222/source/trigger.c +++ b/bthome_phy6222/source/trigger.c @@ -97,7 +97,7 @@ void set_trigger_out(void) { #ifdef GPIO_INP measured_data.flg.pin_input = hal_gpio_read(GPIO_INP); #endif - measured_data.out_flg = *((uint8_t *)&measured_data.flg); +// measured_data.out_flg = *((uint8_t *)&measured_data.flg); } diff --git a/bthome_phy6222/web/PHY62x2BTHome.html b/bthome_phy6222/web/PHY62x2BTHome.html index 4180f06..b160bce 100644 --- a/bthome_phy6222/web/PHY62x2BTHome.html +++ b/bthome_phy6222/web/PHY62x2BTHome.html @@ -1225,17 +1225,21 @@ function customBlkParse(value) { let rds_count = 0; let s = 'Температура: ' + temp.toFixed(2) + '°C, ' + 'Влажность: ' + humi.toFixed(2) + '%, ' - + 'Vbat: ' + vbat + ' мВ, ' + + 'Vbat: ' + vbat + ' мВ ('+pbat+'%), ' + 'ID: ' + count; - if(len > 12) { - flg = value.getUint8(9); - rds_count = value.getUint32(10, true); - s += ', счетчик срабатываний: '+ rds_count+', флаги: 0x'+hex(flg,2)+':r'+(flg&1)+'/t'+((flg>>1)&1); - } - console.log(s); $('lblTemp').innerHTML = temp + ' °C'; $('lblHumi').innerHTML = humi + ' %RH'; $('lblBat').innerHTML = pbat + ' % (' + vbat / 1000 + ' V)'; + if(len > 10) { + flg = value.getUint8(10); + s += ", флаги: 0x" + hex(flg,2); + $('lblTrg').innerHTML = "In: " + (flg&1) + + ", Out: " + ((flg&2)? 1:0) + + ", Cmf: " + ((flg&4)? 1:0) + + ", Te: " + ((flg&16)? 1:0) + + ", He: " + ((flg&32)? 1:0); + } + console.log(s); if(rend) ShowGrf(temp, humi); getDevTime(); } else if((blkId == 0x25 || blkId == 0x26) && (len > 12)) { @@ -1755,7 +1759,6 @@ window.onload = (event) => { window.onresize = (event) => { if(window.innerWidth > 400) $('divDygraph').style.width = (window.innerWidth-40) + 'px';} window.onload = function() { - document.querySelector("#inpFile").addEventListener("change", function() { var file = this.files[0]; if (file != null) { @@ -1801,9 +1804,10 @@ function ShowGrf(temp, humi) { legend: 'always', // "follow" digitsAfterDecimal: 3, }); - gu.updateOptions({'file': datau}) + gu.updateOptions({'file': datau}); + $(window).trigger('resize'); } else if (gu_flg == 3) - gu.updateOptions({'file': datau}) + gu.updateOptions({'file': datau}); } } @@ -1833,6 +1837,7 @@ function ShowGrf(temp, humi) {