diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino index 945c9b8c216b..ef98f5bd52d5 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_10_rules.ino @@ -833,6 +833,15 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved) RulesVarReplace(commands, F("%ZBENDPOINT%"), String(Z_GetLastEndpoint())); #endif + for (uint32_t i = 0; i < MAX_RELAYS; 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++) { + snprintf_P(stemp, sizeof(stemp), PSTR("%%SWITCH%d%%"), i +1); + RulesVarReplace(commands, stemp, String(SwitchState(i))); + } + char command[commands.length() +1]; strlcpy(command, commands.c_str(), sizeof(command)); diff --git a/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino b/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino index 5482183eb87d..5fadb30646e6 100644 --- a/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino +++ b/tasmota/tasmota_xdsp_display/xdsp_17_universal.ino @@ -454,6 +454,16 @@ int8_t cs; Settings->display_width = renderer->width(); Settings->display_height = renderer->height(); + bool iniinv = Settings->display_options.invert; + + cp = strstr(ddesc, ":n,"); + if (cp) { + cp+=3; + iniinv = strtol(cp, &cp, 10); + Settings->display_options.invert = iniinv; + } + renderer->invertDisplay(iniinv); + ApplyDisplayDimmer(); #ifdef SHOW_SPLASH