From 253f7c9f6d0c00b827599e4f75657a55f52c3cf9 Mon Sep 17 00:00:00 2001 From: nngg Date: Fri, 7 May 2021 06:16:05 -0700 Subject: [PATCH] Update xdrv_12_home_assistant.ino allow home assistant discovery of MCP2300xx output as relay --- tasmota/xdrv_12_home_assistant.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasmota/xdrv_12_home_assistant.ino b/tasmota/xdrv_12_home_assistant.ino index b4d1a945a..5f1067ce9 100644 --- a/tasmota/xdrv_12_home_assistant.ino +++ b/tasmota/xdrv_12_home_assistant.ino @@ -448,6 +448,11 @@ void HAssAnnounceRelayLight(void) TasmotaGlobal.masterlog_level = ShowTopic = 4; // Hide topic on clean and remove use weblog 4 to see it bool RelayX = PinUsed(GPIO_REL1, i-1) || (valid_relay >= i) || (TuyaRel > 0 && TuyaMod) || (TuyaRelInv > 0 && TuyaMod); // Check if the gpio is configured as Relay or force it for Sonoff DUAL R1 with MCU and Tuya MCU +#ifdef USE_MCP230xx_OUTPUT + if (i <= TasmotaGlobal.devices_present){ + RelayX = true; + } +#endif //USE_MCP230xx_OUTPUT is_topic_light = Settings.flag.hass_light && RelayX || TasmotaGlobal.light_type && !RelayX || PwmMod || (TuyaDim > 0 && TuyaMod); // SetOption30 - Enforce HAss autodiscovery as light ResponseClear(); // Clear retained message