mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-02-03 08:07:44 +05:00
Compare commits
5 Commits
1e83f284cb
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fcca3c4aa | ||
|
|
2f6bd237c7 | ||
|
|
e4d1ba7d7b | ||
|
|
b70c212235 | ||
|
|
781b2a1f9c |
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -25,8 +25,12 @@ lib_deps =
|
|||||||
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
|
||||||
|
lib_ignore =
|
||||||
|
paulstoffregen/OneWire
|
||||||
build_type = ${secrets.build_type}
|
build_type = ${secrets.build_type}
|
||||||
build_flags =
|
build_flags =
|
||||||
-mtext-section-literals
|
-mtext-section-literals
|
||||||
@@ -73,7 +77,7 @@ platform_packages = ${env.platform_packages}
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
nrwiersma/ESP8266Scheduler@^1.2
|
nrwiersma/ESP8266Scheduler@^1.2
|
||||||
lib_ignore =
|
lib_ignore = ${env.lib_ignore}
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
post:tools/build.py
|
post:tools/build.py
|
||||||
build_type = ${env.build_type}
|
build_type = ${env.build_type}
|
||||||
@@ -92,14 +96,14 @@ check_flags = ${env.check_flags}
|
|||||||
;platform_packages =
|
;platform_packages =
|
||||||
; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.5
|
; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.5
|
||||||
; framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip
|
; framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip
|
||||||
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 =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
laxilef/ESP32Scheduler@^1.0.1
|
laxilef/ESP32Scheduler@^1.0.1
|
||||||
nimble_lib = h2zero/NimBLE-Arduino@2.3.7
|
nimble_lib = h2zero/NimBLE-Arduino@2.3.7
|
||||||
lib_ignore =
|
lib_ignore = ${env.lib_ignore}
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
post:tools/esp32.py
|
post:tools/esp32.py
|
||||||
post:tools/build.py
|
post:tools/build.py
|
||||||
|
|||||||
@@ -135,8 +135,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;
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const unsigned int disconnectedTimeout = 120000;
|
const unsigned int wiredDisconnectTimeout = 180000u;
|
||||||
|
const unsigned int wirelessDisconnectTimeout = 600000u;
|
||||||
const unsigned short dallasSearchInterval = 60000;
|
const unsigned short dallasSearchInterval = 60000;
|
||||||
const unsigned short dallasPollingInterval = 10000;
|
const unsigned short dallasPollingInterval = 10000;
|
||||||
const unsigned short globalPollingInterval = 15000;
|
const unsigned short globalPollingInterval = 15000;
|
||||||
@@ -1004,12 +1005,16 @@ protected:
|
|||||||
} else if (rSensor.connected && sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) {
|
} else if (rSensor.connected && sSensor.purpose == Sensors::Purpose::NOT_CONFIGURED) {
|
||||||
Sensors::setConnectionStatusById(sensorId, false, false);
|
Sensors::setConnectionStatusById(sensorId, false, false);
|
||||||
|
|
||||||
} else if (sSensor.type != Sensors::Type::MANUAL && rSensor.connected && (millis() - rSensor.activityTime) > this->disconnectedTimeout) {
|
} else if (rSensor.connected) {
|
||||||
Sensors::setConnectionStatusById(sensorId, false, false);
|
if (sSensor.type == Sensors::Type::MANUAL || sSensor.type == Sensors::Type::BLUETOOTH) {
|
||||||
|
if ((millis() - rSensor.activityTime) > this->wirelessDisconnectTimeout) {
|
||||||
|
Sensors::setConnectionStatusById(sensorId, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
}/* else if (!rSensor.connected) {
|
} else if ((millis() - rSensor.activityTime) > this->wiredDisconnectTimeout) {
|
||||||
rSensor.connected = true;
|
Sensors::setConnectionStatusById(sensorId, false, false);
|
||||||
}*/
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
19
src/utils.h
19
src/utils.h
@@ -2109,21 +2109,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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user