diff --git a/CHANGELOG.md b/CHANGELOG.md index fe36cd2e2..4307c6f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ All notable changes to this project will be documented in this file. ## [12.5.0.1] ### Added - Matter sensors Humidity, Pressure, Illuminance; optimize memory (#18441) -- Command ``SetOption152 0/1`` to select two (default) or one pin bistable relay control (#18386) -- Matter allow `Matter#Initialized` rule once the device is configured +- Command ``SetOption152 0/1`` to select two (0 = default) pin bistable or one (1) pin latching relay control (#18386) +- Matter allow `Matter#Initialized` rule once the device is configured (#18451) ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0c0f50aad..1470f9262 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -112,8 +112,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ## Changelog v12.5.0.1 ### Added -- Command ``SetOption152 0/1`` to select two (default) or one pin bistable relay control [#18386](https://github.com/arendst/Tasmota/issues/18386) +- Command ``SetOption152 0/1`` to select two (0 = default) pin bistable or one (1) pin latching relay control [#18386](https://github.com/arendst/Tasmota/issues/18386) - Matter sensors Humidity, Pressure, Illuminance [#18441](https://github.com/arendst/Tasmota/issues/18441) +- Matter allow `Matter#Initialized` rule once the device is configured [#18451](https://github.com/arendst/Tasmota/issues/18451) ### Breaking Changed diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index cdba8af55..ec4a65f08 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -254,7 +254,7 @@ struct TasmotaGlobal_t { void *log_buffer_mutex; // Control access to log buffer power_t power; // Current copy of Settings->power - power_t power_bistable; // Current state of single pin bistable power + power_t power_latching; // Current state of single pin latching power power_t rel_inverted; // Relay inverted flag (1 = (0 = On, 1 = Off)) power_t rel_bistable; // Relay bistable bitmap power_t last_power; // Last power set state @@ -431,7 +431,7 @@ void setup(void) { TasmotaGlobal.global_state.data = 0xF; // Init global state (wifi_down, mqtt_down) to solve possible network issues TasmotaGlobal.enable_logging = 1; TasmotaGlobal.seriallog_level = LOG_LEVEL_INFO; // Allow specific serial messages until config loaded - TasmotaGlobal.power_bistable = 0x80000000; + TasmotaGlobal.power_latching = 0x80000000; RtcRebootLoad(); if (!RtcRebootValid()) { diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino index 432f7682e..09ffc5f73 100644 --- a/tasmota/tasmota_support/support_tasmota.ino +++ b/tasmota/tasmota_support/support_tasmota.ino @@ -320,12 +320,12 @@ void SetDevicePower(power_t rpower, uint32_t source) { bool update = true; if (bitRead(TasmotaGlobal.rel_bistable, port)) { if (Settings->flag6.bistable_single_pin) { // SetOption152 - (Power) Use single pin bistable - if (0x80000000 == TasmotaGlobal.power_bistable) { - TasmotaGlobal.power_bistable = TasmotaGlobal.power; // Init last known state + if (0x80000000 == TasmotaGlobal.power_latching) { + TasmotaGlobal.power_latching = TasmotaGlobal.power; // Init last known state } - update = (bitRead(TasmotaGlobal.power_bistable, port) != state); + update = (bitRead(TasmotaGlobal.power_latching, port) != state); if (update) { - bitWrite(TasmotaGlobal.power_bistable, port, state); + bitWrite(TasmotaGlobal.power_latching, port, state); bitSet(bistable, port); } @@ -418,6 +418,7 @@ void SetPowerOnState(void) } else { power_t devices_mask = POWER_MASK >> (POWER_SIZE - TasmotaGlobal.devices_present); if (ResetReasonPowerOn()) { + TasmotaGlobal.power_latching = 0; // Single pin latching relay is powered off after re-applying power switch (Settings->poweronstate) { case POWER_ALL_OFF: case POWER_ALL_OFF_PULSETIME_ON: