From bde7f3206e40fb723e12d285727edbcf6aabdbbb Mon Sep 17 00:00:00 2001 From: Paul C Diem Date: Fri, 22 Jan 2021 07:53:10 -0600 Subject: [PATCH] Fix full status for secondary device groups --- tasmota/support_device_groups.ino | 7 ++++++- tasmota/xdrv_35_pwm_dimmer.ino | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tasmota/support_device_groups.ino b/tasmota/support_device_groups.ino index 5ab856cd6..ae4878e97 100644 --- a/tasmota/support_device_groups.ino +++ b/tasmota/support_device_groups.ino @@ -498,7 +498,12 @@ bool _SendDeviceGroupMessage(uint8_t device_group_index, DevGroupMessageType mes building_status_message = true; // Call the drivers to build the status update. - SendDeviceGroupMessage(device_group_index, DGR_MSGTYP_PARTIAL_UPDATE, DGR_ITEM_POWER, TasmotaGlobal.power); + power_t power = TasmotaGlobal.power; + if (Settings.flag4.multiple_device_groups) { // SetOption88 - Enable relays in separate device groups + power >>= device_group_index; + power &= 1; + } + SendDeviceGroupMessage(device_group_index, DGR_MSGTYP_PARTIAL_UPDATE, DGR_ITEM_POWER, power); XdrvMailbox.index = 0; if (device_group_index == 0 && first_device_group_is_local) XdrvMailbox.index = DGR_FLAG_LOCAL; XdrvMailbox.command_code = DGR_ITEM_STATUS; diff --git a/tasmota/xdrv_35_pwm_dimmer.ino b/tasmota/xdrv_35_pwm_dimmer.ino index 3bca88477..0abd2206b 100644 --- a/tasmota/xdrv_35_pwm_dimmer.ino +++ b/tasmota/xdrv_35_pwm_dimmer.ino @@ -254,6 +254,12 @@ void PWMDimmerHandleDevGroupItem(void) #endif // USE_PWM_DIMMER_REMOTE SendLocalDeviceGroupMessage(DGR_MSGTYP_UPDATE, DGR_ITEM_BRI_POWER_ON, Settings.bri_power_on, DGR_ITEM_BRI_PRESET_LOW, Settings.bri_preset_low, DGR_ITEM_BRI_PRESET_HIGH, Settings.bri_preset_high); +#ifdef USE_PWM_DIMMER_REMOTE + else + SendDeviceGroupMessage(device_group_index, DGR_MSGTYP_UPDATE, DGR_ITEM_POWER, remote_pwm_dimmer->power_on, + DGR_ITEM_BRI_POWER_ON, remote_pwm_dimmer->bri_power_on, DGR_ITEM_BRI_PRESET_LOW, remote_pwm_dimmer->bri_preset_low, + DGR_ITEM_BRI_PRESET_HIGH, remote_pwm_dimmer->bri_preset_high); +#endif // USE_PWM_DIMMER_REMOTE break; } } @@ -614,7 +620,7 @@ void PWMDimmerHandleButton(uint32_t button_index, bool pressed) char topic[TOPSZ]; sprintf_P(TasmotaGlobal.mqtt_data, PSTR("Trigger%u"), mqtt_trigger); #ifdef USE_PWM_DIMMER_REMOTE - if (active_remote_pwm_dimmer) { + if (Settings.flag4.multiple_device_groups) { snprintf_P(topic, sizeof(topic), PSTR("cmnd/%s/EVENT"), device_groups[power_button_index].group_name); MqttPublish(topic); }