26 Commits

Author SHA1 Message Date
Yurii
67adb3b9cf Merge branch 'async' into passive_ble 2026-01-26 02:23:19 +03:00
Yurii
ced0385d5b Merge branch 'master' into async 2026-01-26 02:19:54 +03:00
Yurii
7fcca3c4aa chore: fix ha blueprints to support all source sensors 2026-01-26 02:09:57 +03:00
Yurii
2f6bd237c7 chore: updated ha blueprints for new releases 2026-01-26 01:59:03 +03:00
Yurii
e4d1ba7d7b refactor: added different timeouts for wired and wireless sensors 2026-01-26 01:03:26 +03:00
Yurii
aae53d605a fix: move OpenThermTask to 0 core 2026-01-25 22:44:58 +03:00
Yurii
de9276d04e refactor: cosmetic changes 2026-01-25 22:42:48 +03:00
Yurii
cb8cd7c26e feat: added support BTHome v2 format for BLE sensors #215 2026-01-25 22:25:58 +03:00
Yurii
74e321cc1e Merge branch 'async' into passive_ble 2026-01-23 00:26:24 +03:00
Yurii
80e2d8e939 Merge branch 'master' into async 2026-01-23 00:25:12 +03:00
Yurii
b70c212235 fix: filtering fake data from ds18b20 (#217) 2026-01-23 00:19:03 +03:00
Yurii
781b2a1f9c chore: bump pioarduino/platform-espressif32 from 3.3.5 to 3.3.6 2026-01-23 00:17:30 +03:00
Yurii
1e83f284cb chore: dependencies fixed 2026-01-19 22:03:04 +03:00
Yurii
27baf675e5 chore: reformat platformio.ini 2026-01-19 21:44:18 +03:00
Yurii
1fdc06fce6 Merge branch 'async' into passive_ble 2026-01-19 21:38:12 +03:00
Yurii
c39eeee9cf Merge branch 'master' into passive_ble 2025-11-17 13:26:51 +03:00
Yurii
f2fe6036c2 chore: fix dependencies 2025-11-17 13:24:43 +03:00
Yurii
40dc863530 refactor: improved OTA upgrade
https://github.com/ESP32Async/ESPAsyncWebServer/pull/329
2025-11-03 03:19:50 +03:00
Yurii
a40413aeac style: formatting 2025-11-02 23:34:46 +03:00
Yurii
9a045bfc40 Merge branch 'async' into passive_ble 2025-11-02 11:45:06 +03:00
Yurii
c78d2d0c0b refactor: reduced tasks stack size 2025-11-01 19:12:03 +03:00
Yurii
b7825111bb refactor: active + passive BLE scanning 2025-10-22 20:37:36 +03:00
Yurii
d5691ef8f7 refactor: decreased interval and window for scanning BLE 2025-10-22 17:22:02 +03:00
Yurii
0213582464 fix: build for nodemcu32, c3, c6 boards; formatting `platformio.ini` 2025-10-21 13:43:41 +03:00
Yurii
396dc7f7e3 refactor: increased disconnected timeout for sensors 2025-10-20 18:37:35 +03:00
Yurii
9d38525251 refactor: passive scan instead of connecting to BLE devices 2025-10-20 17:59:52 +03:00
8 changed files with 408 additions and 601 deletions

View File

@@ -1,5 +1,5 @@
# Blueprint for reporting indoor/outdoor temperature to OpenTherm Gateway from any home assistant sensor # Blueprint for reporting indoor/outdoor temperature to OpenTherm Gateway from any home assistant sensor
# Updated: 03.09.2024 # Updated: 26.01.2026
blueprint: blueprint:
name: Report temp to OpenTherm Gateway name: Report temp to OpenTherm Gateway
@@ -15,7 +15,6 @@ blueprint:
multiple: false multiple: false
filter: filter:
- domain: sensor - domain: sensor
device_class: temperature
target_entity: target_entity:
name: Target entity name: Target entity
description: "Usually ``number.opentherm_indoor_temp`` or ``number.opentherm_outdoor_temp``" description: "Usually ``number.opentherm_indoor_temp`` or ``number.opentherm_outdoor_temp``"
@@ -38,8 +37,12 @@ condition:
value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}" value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}"
action: action:
- if: - if:
- condition: template - condition: or
value_template: "{{ (states(source_entity)|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.01 }}" conditions:
- condition: template
value_template: "{{ (states(source_entity)|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.01 }}"
- condition: template
value_template: "{{ (as_timestamp(now()) - as_timestamp(states[target_entity].last_updated)) | int(0) > 300 }}"
then: then:
- service: number.set_value - service: number.set_value
data: data:

View File

@@ -1,5 +1,5 @@
# Blueprint for reporting temperature to OpenTherm Gateway from home assistant weather integration # Blueprint for reporting temperature to OpenTherm Gateway from home assistant weather integration
# Updated: 03.09.2024 # Updated: 26.01.2026
blueprint: blueprint:
name: Report temp to OpenTherm Gateway from Weather name: Report temp to OpenTherm Gateway from Weather
@@ -37,8 +37,12 @@ condition:
value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}" value_template: "{{ states(source_entity) != 'unavailable' and states(target_entity) != 'unavailable' }}"
action: action:
- if: - if:
- condition: template - condition: or
value_template: "{{ (state_attr(source_entity, 'temperature')|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.1 }}" conditions:
- condition: template
value_template: "{{ (state_attr(source_entity, 'temperature')|float(0) - states(target_entity)|float(0)) | abs | round(2) >= 0.1 }}"
- condition: template
value_template: "{{ (as_timestamp(now()) - as_timestamp(states[target_entity].last_updated)) | int(0) > 300 }}"
then: then:
- service: number.set_value - service: number.set_value
data: data:

View File

@@ -4,11 +4,11 @@ extra_configs = secrets.default.ini
core_dir = .pio core_dir = .pio
[env] [env]
version = 1.6.0-async version = 1.6.0-passiveble
framework = arduino framework = arduino
lib_deps = ESP32Async/AsyncTCP@^2.0.0 lib_deps = ESP32Async/AsyncTCP@^3.4.10
ESP32Async/ESPAsyncWebServer@^3.9.4 ESP32Async/ESPAsyncWebServer@^3.9.4
mathieucarbou/MycilaWebSerial@^8.2.0 mathieucarbou/MycilaWebSerial@^8.2.0
bblanchon/ArduinoJson@^7.4.2 bblanchon/ArduinoJson@^7.4.2
;ihormelnyk/OpenTherm Library@^1.1.5 ;ihormelnyk/OpenTherm Library@^1.1.5
https://github.com/Laxilef/opentherm_library#esp32_timer https://github.com/Laxilef/opentherm_library#esp32_timer
@@ -16,9 +16,12 @@ lib_deps = ESP32Async/AsyncTCP@^2.0.0
gyverlibs/FileData@^1.0.3 gyverlibs/FileData@^1.0.3
gyverlibs/GyverPID@^3.3.2 gyverlibs/GyverPID@^3.3.2
gyverlibs/GyverBlinker@^1.1.1 gyverlibs/GyverBlinker@^1.1.1
https://github.com/pstolarz/Arduino-Temperature-Control-Library.git#OneWireNg pstolarz/OneWireNg@^0.14.1
;milesburton/DallasTemperature@^4.0.5
https://github.com/Laxilef/Arduino-Temperature-Control-Library#fix_85c
;laxilef/TinyLogger@^1.1.1 ;laxilef/TinyLogger@^1.1.1
https://github.com/Laxilef/TinyLogger#custom_handlers https://github.com/Laxilef/TinyLogger#custom_handlers
lib_ignore = paulstoffregen/OneWire
build_type = ${secrets.build_type} build_type = ${secrets.build_type}
build_flags = -mtext-section-literals build_flags = -mtext-section-literals
-Wno-deprecated-declarations -Wno-deprecated-declarations
@@ -29,7 +32,7 @@ build_flags = -mtext-section-literals
-D CONFIG_ASYNC_TCP_STACK_SIZE=4096 -D CONFIG_ASYNC_TCP_STACK_SIZE=4096
-D ARDUINOJSON_USE_DOUBLE=0 -D ARDUINOJSON_USE_DOUBLE=0
-D ARDUINOJSON_USE_LONG_LONG=0 -D ARDUINOJSON_USE_LONG_LONG=0
-D TINYLOGGER_GLOBAL -D TINYLOGGER_GLOBAL
-D DEFAULT_SERIAL_ENABLED=${secrets.serial_enabled} -D DEFAULT_SERIAL_ENABLED=${secrets.serial_enabled}
-D DEFAULT_SERIAL_BAUD=${secrets.serial_baud} -D DEFAULT_SERIAL_BAUD=${secrets.serial_baud}
-D DEFAULT_WEBSERIAL_ENABLED=${secrets.webserial_enabled} -D DEFAULT_WEBSERIAL_ENABLED=${secrets.webserial_enabled}
@@ -58,13 +61,14 @@ check_flags = ;pvs-studio: --analysis-mode=4 --exclude-path=./.pio/l
; Defaults ; Defaults
[esp32_defaults] [esp32_defaults]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.36/platform-espressif32.zip
platform_packages = ${env.platform_packages} platform_packages = ${env.platform_packages}
board_build.partitions = esp32_partitions.csv board_build.partitions = esp32_partitions.csv
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
laxilef/ESP32Scheduler@^1.0.1 laxilef/ESP32Scheduler@^1.0.1
nimble_lib = https://github.com/h2zero/NimBLE-Arduino nimble_lib = https://github.com/h2zero/NimBLE-Arduino
lib_ignore = BluetoothSerial lib_ignore = ${env.lib_ignore}
BluetoothSerial
SimpleBLE SimpleBLE
ESP RainMaker ESP RainMaker
RainMaker RainMaker
@@ -143,7 +147,7 @@ lib_deps = ${esp32_defaults.lib_deps}
build_unflags = -mtext-section-literals build_unflags = -mtext-section-literals
build_flags = ${esp32_defaults.build_flags} build_flags = ${esp32_defaults.build_flags}
-D MYNEWT_VAL_BLE_EXT_ADV=1 -D MYNEWT_VAL_BLE_EXT_ADV=1
-D USE_BLE=1 -D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=8 -D DEFAULT_OT_IN_GPIO=8
-D DEFAULT_OT_OUT_GPIO=10 -D DEFAULT_OT_OUT_GPIO=10
-D DEFAULT_SENSOR_OUTDOOR_GPIO=0 -D DEFAULT_SENSOR_OUTDOOR_GPIO=0
@@ -205,7 +209,7 @@ lib_deps = ${esp32_defaults.lib_deps}
${esp32_defaults.nimble_lib} ${esp32_defaults.nimble_lib}
build_unflags = -mtext-section-literals build_unflags = -mtext-section-literals
build_flags = ${esp32_defaults.build_flags} build_flags = ${esp32_defaults.build_flags}
-D MYNEWT_VAL_BLE_EXT_ADV=1 -D MYNEWT_VAL_BLE_EXT_ADV=1
-D USE_BLE=1 -D USE_BLE=1
-D DEFAULT_OT_IN_GPIO=3 -D DEFAULT_OT_IN_GPIO=3
-D DEFAULT_OT_OUT_GPIO=1 -D DEFAULT_OT_OUT_GPIO=1

View File

@@ -49,6 +49,10 @@ protected:
return "Main"; return "Main";
} }
uint32_t getTaskStackSize() override {
return 6000;
}
/*BaseType_t getTaskCore() override { /*BaseType_t getTaskCore() override {
return 1; return 1;
}*/ }*/
@@ -128,8 +132,6 @@ protected:
tMqtt->disable(); tMqtt->disable();
} }
Sensors::setConnectionStatusByType(Sensors::Type::MANUAL, !settings.mqtt.enabled || vars.mqtt.connected, false);
} else { } else {
if (this->ntpStarted) { if (this->ntpStarted) {
this->ntpStarted = false; this->ntpStarted = false;

View File

@@ -38,8 +38,12 @@ protected:
return "OpenTherm"; return "OpenTherm";
} }
uint32_t getTaskStackSize() override {
return 7500;
}
BaseType_t getTaskCore() override { BaseType_t getTaskCore() override {
return 1; return 0;
} }
int getTaskPriority() override { int getTaskPriority() override {

View File

@@ -20,6 +20,10 @@ protected:
return "Regulator"; return "Regulator";
} }
uint32_t getTaskStackSize() override {
return 5000;
}
/*BaseType_t getTaskCore() override { /*BaseType_t getTaskCore() override {
return 1; return 1;
}*/ }*/

File diff suppressed because it is too large Load Diff

View File

@@ -2099,21 +2099,18 @@ bool jsonToSensorResult(const uint8_t sensorId, const JsonVariantConst src) {
return false; return false;
} }
auto& dst = Sensors::results[sensorId];
bool changed = false;
// value // value
if (!src[FPSTR(S_VALUE)].isNull()) { if (!src[FPSTR(S_VALUE)].isNull()) {
float value = src[FPSTR(S_VALUE)].as<float>(); return Sensors::setValueById(
sensorId,
uint8_t vType = static_cast<uint8_t>(Sensors::ValueType::PRIMARY); src[FPSTR(S_VALUE)].as<float>(),
if (fabsf(value - dst.values[vType]) > 0.0001f) { Sensors::ValueType::PRIMARY,
dst.values[vType] = roundf(value, 2); true,
changed = true; true
} );
} }
return changed; return false;
} }
void varsToJson(const Variables& src, JsonVariant dst) { void varsToJson(const Variables& src, JsonVariant dst) {