diff --git a/tasmota/include/tasmota_configurations_ESP32.h b/tasmota/include/tasmota_configurations_ESP32.h index b252a2275..661440aea 100644 --- a/tasmota/include/tasmota_configurations_ESP32.h +++ b/tasmota/include/tasmota_configurations_ESP32.h @@ -723,6 +723,7 @@ #define USE_HRE // Add support for Badger HR-E Water Meter (+1k4 code) //#define USE_A4988_STEPPER // Add support for A4988/DRV8825 stepper-motor-driver-circuit (+10k5 code) //#define USE_THERMOSTAT // Add support for Thermostat +#define USE_BP1658CJ // Add support for BP1658CJ 5 channel led controller as used in Orein OS0100411267 Bulb #define USE_ETHERNET // Add support for ethernet (+20k code) #define USE_DISPLAY_TM1621_SONOFF // Add support for TM1621 display driver used by Sonoff POWR3xxD and THR3xxD diff --git a/tasmota/include/tasmota_template.h b/tasmota/include/tasmota_template.h index 831115456..e778914ed 100644 --- a/tasmota/include/tasmota_template.h +++ b/tasmota/include/tasmota_template.h @@ -199,6 +199,7 @@ enum UserSelectablePins { GPIO_NRG_MBS_TX, GPIO_NRG_MBS_RX, // Generic Energy Modbus device GPIO_ADE7953_CS, // ADE7953 SPI Chip Select GPIO_DALI_RX, GPIO_DALI_TX, // Dali + GPIO_BP1658CJ_CLK, GPIO_BP1658CJ_DAT,// BP1658CJ GPIO_SENSOR_END }; // Error as warning to rethink GPIO usage with max 2045 @@ -445,6 +446,7 @@ const char kSensorNames[] PROGMEM = D_SENSOR_NRG_MBS_TX "|" D_SENSOR_NRG_MBS_RX "|" D_SENSOR_ADE7953_CS "|" D_SENSOR_DALI_RX "|" D_SENSOR_DALI_TX "|" + D_SENSOR_BP1658CJ_CLK "|" D_SENSOR_BP1658CJ_DAT "|" ; const char kSensorNamesFixed[] PROGMEM = @@ -459,6 +461,7 @@ const char kSensorNamesFixed[] PROGMEM = #define MAX_SM2135_DAT 10 #define MAX_SM2335_DAT 16 #define MAX_DSB 4 +#define MAX_BP1658CJ_DAT 16 const uint16_t kGpioNiceList[] PROGMEM = { GPIO_NONE, // Not used @@ -715,6 +718,10 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_SM2335_CLK), // SM2335 CLOCK AGPIO(GPIO_SM2335_DAT) + MAX_SM2335_DAT, // SM2335 DATA #endif // USE_SM2335 +#ifdef USE_BP1658CJ + AGPIO(GPIO_BP1658CJ_CLK), // BP1658CJ CLOCK + AGPIO(GPIO_BP1658CJ_DAT) + MAX_BP1658CJ_DAT, // BP1658CJ DATA +#endif // USE_BP1658CJ #ifdef USE_BP5758D AGPIO(GPIO_BP5758D_CLK), // BP5758D CLOCK AGPIO(GPIO_BP5758D_DAT), // BP5758D DATA diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index 53f836a14..30093df20 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "Diep slaap" diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 784a15f90..dc1fc3d93 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index eb3d4d797..082a1120f 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index d4ba67d4a..4c0db3230 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index a7e79adf7..faaf0bac8 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 392abdb0e..12e6cd29f 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 62043d5c5..104ceb164 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index 3a26c486f..e24243a8f 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 DAT" #define D_SENSOR_SM2335_CLK "SM2335 CLK" #define D_SENSOR_SM2335_DAT "SM2335 DAT" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "Hibernation" diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index 4e2bb00a1..fbbf72aa7 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index afde4734d..b94395a19 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 1d753de1b..1a87c6ba1 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index 05dc90c7e..a335c9d16 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -798,6 +798,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 - DATI" #define D_SENSOR_SM2335_CLK "SM2335 - CLK" #define D_SENSOR_SM2335_DAT "SM2335 - DATI" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ - CLK" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ - DATI" #define D_SENSOR_BP5758D_CLK "BP5758D - CLK" #define D_SENSOR_BP5758D_DAT "BP5758D - DATI" #define D_SENSOR_DEEPSLEEP "Sleep profondo" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index 7fd6d1864..8b3419e98 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index d0f96fe48..4b1b33995 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index a4237e480..d0c98a130 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "Głęboko uśpiony" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index ed31fc1f9..1a429027c 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index e1bde2d58..0b3cd1411 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index b9db344a1..6ceff55a7 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 5e38b74f9..2cf65b605 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 2565fd648..8dec871f6 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index 6c85c366f..ee8eb9167 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index a32bd177a..c0dc1bc30 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index b786a6700..3205c06f6 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index c054ed967..1552aa798 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 63d885088..d34849db2 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 30db4a4f1..22f72da25 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -800,6 +800,8 @@ #define D_SENSOR_SM2135_DAT "SM2135 Dat" #define D_SENSOR_SM2335_CLK "SM2335 Clk" #define D_SENSOR_SM2335_DAT "SM2335 Dat" +#define D_SENSOR_BP1658CJ_CLK "BP1658CJ Clk" +#define D_SENSOR_BP1658CJ_DAT "BP1658CJ Dat" #define D_SENSOR_BP5758D_CLK "BP5758D Clk" #define D_SENSOR_BP5758D_DAT "BP5758D Dat" #define D_SENSOR_DEEPSLEEP "DeepSleep" diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index b4bc564ef..aacbc1b64 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -562,6 +562,7 @@ #define USE_SM16716 // Add support for SM16716 RGB LED controller (+0k7 code) #define USE_SM2135 // Add support for SM2135 RGBCW led control as used in Action LSC (+0k6 code) #define USE_SM2335 // Add support for SM2335 RGBCW led control as used in SwitchBot Color Bulb (+0k7 code) +#define USE_BP1658CJ // Add support for BP1658CJ RGBCW led control as used in Orein OS0100411267 Bulb #define USE_BP5758D // Add support for BP5758D RGBCW led control as used in some Tuya lightbulbs (+0k8 code) #define USE_SONOFF_L1 // Add support for Sonoff L1 led control #define USE_ELECTRIQ_MOODL // Add support for ElectriQ iQ-wifiMOODL RGBW LED controller (+0k3 code) diff --git a/tasmota/tasmota_xlgt_light/xlgt_10_bp1658cj.ino b/tasmota/tasmota_xlgt_light/xlgt_10_bp1658cj.ino new file mode 100644 index 000000000..840022e23 --- /dev/null +++ b/tasmota/tasmota_xlgt_light/xlgt_10_bp1658cj.ino @@ -0,0 +1,180 @@ +/* + xlgt_10_bp1658cj.ino - bp1658cj five channel led support for Tasmota + + Copyright (C) 2022 Theo Arends and Cossid + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#define US_BP1658CJ +#ifdef USE_LIGHT +#ifdef USE_BP1658CJ +/*********************************************************************************************\ + * BP1658CJ RGBCW Led bulbs like the Orein OS0100411267 Bulb + * + * Orein OS0100411267 Bulb + * + * + * FIXME + * {"NAME":"Orein OS0100411267 Bulb","GPIO":[0,0,0,0,9129,9088,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":1} +\*********************************************************************************************/ + +#define XLGT_10 10 + +// 10 = identification | 00 = Standby | 0000 = start at OUT1/5 +#define BP1658CJ_ADDR_STANDBY 0x80 // 10000000 0x80 +// 10 = identification | 01 = 3 channels (RGB) | 0000 = start at OUT1/5 +//#define BP1658CJ_ADDR_START_3CH 0x90 // 10010000 0xC8 +// 10 = identification | 10 = 2 channels (CW) | 0000 = start at OUT1/5 +//#define BP1658CJ_ADDR_START_2CH 0xA0 // 10100000 0xA0 +// 10 = identification | 11 = 5 channels (RGB+CW) | 0000 = start at OUT1/5 +#define BP1658CJ_ADDR_START_5CH 0xB0 // 10110000 0xB0 + +// Current values +// 0x0 // 0000 RGB 0mA | CW 0mA +// 0x1 // 0001 RGB 10mA | CW 5mA +// 0x2 // 0010 RGB 20mA | CW 10mA +// 0x3 // 0011 RGB 30mA | CW 15mA +// 0x4 // 0100 RGB 40mA | CW 20mA +// 0x5 // 0101 RGB 50mA | CW 25mA +// 0x6 // 0110 RGB 60mA | CW 30mA +// 0x7 // 0111 RGB 70mA | CW 35mA +// 0x8 // 1000 RGB 80mA | CW 40mA +// 0x9 // 1001 RGB 900mA | CW 45mA +// 0xA // 1010 RGB 100mA | CW 50mA +// 0xB // 1011 RGB 110mA | CW 55mA +// 0xC // 1100 RGB 120mA | CW 60mA +// 0xD // 1101 RGB 130mA | CW 65mA +// 0xE // 1110 RGB 140mA | CW 70mA +// 0xF // 1111 RGB 150mA | CW 75mA + +struct BP1658CJ { + uint8_t clk = 0; + uint8_t data = 0; + uint8_t current; +} Bp1658cj; + +/*********************************************************************************************\ + * BP1658CJ code - inspired by Bp5758d/SM2335 +\*********************************************************************************************/ +const uint8_t BP1658CJ_DELAY = 2; + +void BP1658CJInit(void) { + pinMode(Bp1658cj.data, OUTPUT); + pinMode(Bp1658cj.clk, OUTPUT); + BP1658CJStop(); +} + +void BP1658CJWrite(uint8_t value) { + for (int bit_idx = 7; bit_idx >= 0; bit_idx--) { + bool bit = bitRead(value, bit_idx); + digitalWrite(Bp1658cj.data, bit); + delayMicroseconds(BP1658CJ_DELAY); + digitalWrite(Bp1658cj.clk, HIGH); + delayMicroseconds(BP1658CJ_DELAY); + digitalWrite(Bp1658cj.clk, LOW); + delayMicroseconds(BP1658CJ_DELAY); + } + // Wait for ACK + pinMode(Bp1658cj.data, INPUT); + digitalWrite(Bp1658cj.clk, HIGH); + delayMicroseconds(BP1658CJ_DELAY); + digitalWrite(Bp1658cj.clk, LOW); + delayMicroseconds(BP1658CJ_DELAY); + pinMode(Bp1658cj.data, OUTPUT); +} + +void BP1658CJStart(uint8_t addr) { + digitalWrite(Bp1658cj.data, LOW); + delayMicroseconds(BP1658CJ_DELAY); + digitalWrite(Bp1658cj.clk, LOW); + delayMicroseconds(BP1658CJ_DELAY); + BP1658CJWrite(addr); +} + +void BP1658CJStop(void) { + digitalWrite(Bp1658cj.clk, HIGH); + delayMicroseconds(BP1658CJ_DELAY); + digitalWrite(Bp1658cj.data, HIGH); + delayMicroseconds(BP1658CJ_DELAY); +} + +/********************************************************************************************/ + +bool BP1658CJSetChannels(void) { + uint16_t *cur_col_10 = (uint16_t*)XdrvMailbox.command; + + // If we receive 0 for all channels, we'll assume that the lightbulb is off, and activate BP1658CJ's standby mode. + if (cur_col_10[0] == 0 && cur_col_10[1] == 0 && cur_col_10[2] == 0 && cur_col_10[3] == 0 && cur_col_10[4] == 0) { + BP1658CJStart(BP1658CJ_ADDR_STANDBY); + // Clear all remaining data. This clears out Current, Red, Green, Blue, Cold White, Warm White. + for (int i = 0; i < 11; i++) { + BP1658CJWrite(0); + } + BP1658CJStop(); + return true; + } + + // Write the header activating all 5 channels + BP1658CJStart(BP1658CJ_ADDR_START_5CH); + // Set the current defined in ModuleSelected. + BP1658CJWrite(Bp1658cj.current); + // Set RGB and CW grayscale. + for (int i = 0; i < 5; i++) { + BP1658CJWrite((uint8_t)(cur_col_10[i] & 0x1F)); + BP1658CJWrite((uint8_t)(cur_col_10[i] >> 5)); + } + BP1658CJStop(); + return true; +} + +void BP1658CJModuleSelected(void) +{ + if (PinUsed(GPIO_BP1658CJ_CLK) && PinUsed(GPIO_BP1658CJ_DAT, GPIO_ANY)) { + Bp1658cj.clk = Pin(GPIO_BP1658CJ_CLK); + Bp1658cj.data = Pin(GPIO_BP1658CJ_DAT, GPIO_ANY); + // See #define MAX_BP1658CJ_DAT 16 in tasmota_template.h + int currentDat = GetPin(Bp1658cj.data) - AGPIO(GPIO_BP1658CJ_DAT); // 0 .. 15 + // Split RGB and CW current. + Bp1658cj.current = (currentDat << 4) | currentDat; + + BP1658CJInit(); + + TasmotaGlobal.light_type = LT_RGBWC; + TasmotaGlobal.light_driver = XLGT_10; + AddLog(LOG_LEVEL_DEBUG, PSTR("LGT: BP1658CJ Found")); + } +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xlgt10(uint8_t function) +{ + bool result = false; + + switch (function) { + case FUNC_SET_CHANNELS: + result = BP1658CJSetChannels(); + break; + case FUNC_MODULE_INIT: + BP1658CJModuleSelected(); + break; + } + return result; +} + +#endif // USE_BP1658CJ +#endif // USE_LIGHT