diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index 21654bbc3..2b568a965 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -52,6 +52,7 @@ template_t g_templates [] = { { Setup_Device_NedisWIFIP130FWT_10A, "Nedis WIFIP130FWT SmartPlug 10A"}, { Setup_Device_BK7231T_Raw_PrimeWiFiSmartOutletsOutdoor_CCWFIO232PK, "Prime SmartOutlet Outdoor 2x Costco"}, { Setup_Device_EmaxHome_EDU8774, "Emax Home EDU8774 SmartPlug 16A"}, + { Setup_Device_BK7231N_TuyaLightBulb_RGBCW_5PWMs, "Tuya E27 LED RGBCW 5PWMs BK7231N"}, { Setup_Device_TuyaSmartPFW02G, "Tuya Smart PFW02-G"}, { Setup_Device_AvatarASL04, "Avatar ASL04 5v LED strip"} }; diff --git a/src/new_builtin_devices.c b/src/new_builtin_devices.c index ad9cacc86..05513ea6b 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -49,6 +49,37 @@ void Setup_Device_TuyaSmartLife4CH10A() { PIN_SaveToFlash(); } +// Tuya "12W" smart light bulb +// "Tuya Wifi Smart Life Light Bulb Lamp E27 LED RGBCW Dimmable For Alexa/Google 18W +// See this topic: https://www.elektroda.pl/rtvforum/viewtopic.php?t=3880540&highlight= +void Setup_Device_BK7231N_TuyaLightBulb_RGBCW_5PWMs() { + PIN_ClearPins(); + + // RGBCW, in that order + // Raw PWMS (no I2C) + + // P26 - red + PIN_SetPinRoleForPinIndex(26, IOR_PWM); + PIN_SetPinChannelForPinIndex(26, 1); + + // P8 - green + PIN_SetPinRoleForPinIndex(8, IOR_PWM); + PIN_SetPinChannelForPinIndex(8, 2); + + // P7 - blue + PIN_SetPinRoleForPinIndex(7, IOR_PWM); + PIN_SetPinChannelForPinIndex(7, 3); + + // P9 - cold white + PIN_SetPinRoleForPinIndex(9, IOR_PWM); + PIN_SetPinChannelForPinIndex(9, 4); + + // P6 - warm white + PIN_SetPinRoleForPinIndex(6, IOR_PWM); + PIN_SetPinChannelForPinIndex(6, 5); + + PIN_SaveToFlash(); +} // https://www.elektroda.pl/rtvforum/viewtopic.php?p=19743751#19743751 void Setup_Device_IntelligentLife_NF101A() { PIN_ClearPins(); diff --git a/src/new_pins.h b/src/new_pins.h index 09eb7bf28..850373ee8 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -67,6 +67,7 @@ void PIN_set_wifi_led(int value); void Setup_Device_Empty(); void Setup_Device_TuyaWL_SW01_16A(); void Setup_Device_TuyaSmartLife4CH10A(); +void Setup_Device_BK7231N_TuyaLightBulb_RGBCW_5PWMs(); void Setup_Device_IntelligentLife_NF101A(); void Setup_Device_TuyaLEDDimmerSingleChannel(); void Setup_Device_CalexLEDDimmerFiveChannel();