diff --git a/CHANGELOG.md b/CHANGELOG.md index fd144f208..d9918dd56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. ## [13.1.0.1] ### Added +- Commands to allow setting of timeprop parameters (#19310) +- Variables ``%power<1..28>%`` and ``%switch<1..28>%`` to rules (#19331) ### Breaking Changed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 9fc969ea7..884d4baf9 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -112,6 +112,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm ## Changelog v13.1.0.1 ### Added +- Commands to allow setting of timeprop parameters [#19310](https://github.com/arendst/Tasmota/issues/19310) +- Variables ``%power<1..28>%`` and ``%switch<1..28>%`` to rules [#19331](https://github.com/arendst/Tasmota/issues/19331) ### Breaking Changed diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino index 8fe9f2d50..945c9b8c2 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino @@ -793,6 +793,16 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved) snprintf_P(stemp, sizeof(stemp), PSTR("%%MEM%d%%"), i +1); RulesVarReplace(commands, stemp, SettingsText(SET_MEM1 +i)); } + for (uint32_t i = 0; i < TasmotaGlobal.devices_present; i++) { + snprintf_P(stemp, sizeof(stemp), PSTR("%%POWER%d%%"), i +1); + RulesVarReplace(commands, stemp, String(bitRead(TasmotaGlobal.power, i))); + } + for (uint32_t i = 0; i < MAX_SWITCHES_SET; i++) { + if (SwitchUsed(i)) { + snprintf_P(stemp, sizeof(stemp), PSTR("%%SWITCH%d%%"), i +1); + RulesVarReplace(commands, stemp, String(SwitchState(i))); + } + } RulesVarReplace(commands, F("%TIME%"), String(MinutesPastMidnight())); RulesVarReplace(commands, F("%UTCTIME%"), String(UtcTime())); RulesVarReplace(commands, F("%UPTIME%"), String(MinutesUptime()));