Merge pull request #7947 from ianbyte/development

Add support for the ElectriQ iQ-wifiMOODL RGBW LED controller
This commit is contained in:
Theo Arends 2020-03-18 12:13:39 +01:00 committed by GitHub
commit c1d7da258e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 137 additions and 1 deletions

View File

@ -53,6 +53,7 @@
| USE_SM16716 | - | - | x | x | x | - | x |
| USE_SM2135 | - | - | x | x | x | - | x |
| USE_SONOFF_L1 | - | - | x | x | x | - | x |
| USE_ELECTRIQ_MOODL | - | - | - | - | - | - | - |
| | | | | | | | |
| USE_ENERGY_SENSOR | - | x | x | x | x | - | - |
| USE_PZEM004T | - | - | x | x | x | - | - |

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "А"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "A"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "А"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "安"

View File

@ -663,6 +663,7 @@
#define D_SENSOR_CC1101_GDO0 "CC1101 GDO0"
#define D_SENSOR_CC1101_GDO2 "CC1101 GDO2"
#define D_SENSOR_HRXL_RX "HRXL Rx"
#define D_SENSOR_ELECTRIQ_MOODL "MOODL Tx"
// Units
#define D_UNIT_AMPERE "安"

View File

@ -431,6 +431,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_SONOFF_L1 // Add support for Sonoff L1 led control
#define USE_ELECTRIQ_MOODL // Add support for ElectriQ iQ-wifiMOODL RGBW LED controller
// -- Counter input -------------------------------
#define USE_COUNTER // Enable inputs as counter (+0k8 code)

View File

@ -135,6 +135,7 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack
#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_SONOFF_L1 // Add support for Sonoff L1 led control
//#define USE_ELECTRIQ_MOODL // Add support for ElectriQ iQ-wifiMOODL RGBW LED controller
#define USE_COUNTER // Enable counters
#undef USE_ADC_VCC // Add Analog input on selected devices
@ -400,6 +401,7 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack
#undef USE_SM16716 // Disable support for SM16716 RGB LED controller (+0k7 code)
#undef USE_SM2135 // Disable support for SM2135 RGBCW led control as used in Action LSC (+0k6 code)
#undef USE_SONOFF_L1 // Disable support for Sonoff L1 led control
#undef USE_ELECTRIQ_MOODL // Add support for ElectriQ iQ-wifiMOODL RGBW LED controller
#undef USE_ENERGY_SENSOR // Disable energy sensors (-14k code)
#undef USE_PZEM004T // Disable PZEM004T energy sensor
@ -513,6 +515,7 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack
#undef USE_SM16716 // Disable support for SM16716 RGB LED controller (+0k7 code)
#undef USE_SM2135 // Disable support for SM2135 RGBCW led control as used in Action LSC (+0k6 code)
#undef USE_SONOFF_L1 // Disable support for Sonoff L1 led control
#undef USE_ELECTRIQ_MOODL // Add support for ElectriQ iQ-wifiMOODL RGBW LED controller
#undef USE_COUNTER // Disable counters
#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices
@ -633,6 +636,7 @@ extern "C" void custom_crash_callback(struct rst_info * rst_info, uint32_t stack
#undef USE_SM16716 // Disable support for SM16716 RGB LED controller (+0k7 code)
#undef USE_SM2135 // Disable support for SM2135 RGBCW led control as used in Action LSC (+0k6 code)
#undef USE_SONOFF_L1 // Disable support for Sonoff L1 led control
#undef USE_ELECTRIQ_MOODL // Add support for ElectriQ iQ-wifiMOODL RGBW LED controller
#undef USE_COUNTER // Disable counters
#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices

View File

@ -225,6 +225,7 @@ enum UserSelectablePins {
GPIO_CC1101_GDO0, // CC1101 pin for RX
GPIO_CC1101_GDO2, // CC1101 pin for RX
GPIO_HRXL_RX, // Data from MaxBotix HRXL sonar range sensor
GPIO_ELECTRIQ_MOODL_TX, // ElectriQ iQ-wifiMOODL Serial TX
GPIO_SENSOR_END };
// Programmer selectable GPIO functionality
@ -310,7 +311,8 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_HM10_RX "|" D_SENSOR_HM10_TX "|"
D_SENSOR_LE01MR_RX "|" D_SENSOR_LE01MR_TX "|"
D_SENSOR_CC1101_GDO0 "|" D_SENSOR_CC1101_GDO2 "|"
D_SENSOR_HRXL_RX
D_SENSOR_HRXL_RX "|"
D_SENSOR_ELECTRIQ_MOODL
;
const char kSensorNamesFixed[] PROGMEM =
@ -611,6 +613,9 @@ const uint8_t kGpioNiceList[] PROGMEM = {
#ifdef USE_EXS_DIMMER
GPIO_EXS_ENABLE, // EXS MCU Enable
#endif
#ifdef USE_ELECTRIQ_MOODL
GPIO_ELECTRIQ_MOODL_TX,
#endif
#endif // USE_LIGHT
#if defined(USE_IR_REMOTE) || defined(USE_IR_REMOTE_FULL)

View File

@ -0,0 +1,102 @@
/*
xlgt_06_moodlamp.ino - ElectriQ iQ-wifiMOODL LED support for Tasmota
Copyright (C) 2020 Theo Arends
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 <http://www.gnu.org/licenses/>.
*/
#ifdef USE_LIGHT
#ifdef USE_ELECTRIQ_MOODL
/*********************************************************************************************\
* ElectriQ iQ-wifiMOODL
* This RGBW mood lamp uses the TYWE3S module to transmit via UART to an unmarked MCU which
* drives 8 MOSFETs. The MCU does not transmit; it only receives commands from the TYWE3S.
* The MCU appears to use a modified/undocumented version of the TuyaMCU protocol.
* The main PCB has 2 daughter boards which hold the RGBW LEDs - an upper deck and a lower deck.
* The same RGBW data is transmitted to the upper and lower decks.
* *********************************************************************************************/
#define XLGT_06 6
/********************************************************************************************/
bool ElectriqMoodLSetChannels(void)
{
uint8_t *col = (uint8_t*)XdrvMailbox.data;
uint8_t checksum = (uint8_t)(0x65 + 0xAA + 0x01 + 0x0A);
Serial.write(0x65); // Fixed header
Serial.write(0xAA);
Serial.write(0x00); // Version
Serial.write(0x01); // Command
Serial.write(0x0A); // Payload length
uint8_t payload[5];
payload[0] = col[0];
payload[1] = col[1];
payload[2] = col[2];
payload[3] = col[3];
payload[4] = 0x0; // Unused
// Send payload for the upper LED deck
for (uint32_t i = 0; i < 5; i++) {
Serial.write(payload[i]);
checksum += payload[i];
}
// Send payload for the lower LED deck
for (uint32_t i = 0; i < 5; i++) {
Serial.write(payload[i]);
checksum += payload[i];
}
Serial.write(checksum);
Serial.flush();
return true;
}
void ElectriqMoodLModuleSelected(void)
{
if (pin[GPIO_ELECTRIQ_MOODL_TX] < 99) {
SetSerial(9600, TS_SERIAL_8N1);
light_type = LT_RGBW;
light_flg = XLGT_06;
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DBG: ElectriQ Mood Lamp Found"));
}
}
/*********************************************************************************************\
* Interface
\*********************************************************************************************/
bool Xlgt06(uint8_t function)
{
bool result = false;
switch (function) {
case FUNC_SET_CHANNELS:
result = ElectriqMoodLSetChannels();
break;
case FUNC_MODULE_INIT:
ElectriqMoodLModuleSelected();
break;
}
return result;
}
#endif // USE_ELECTRIQ_MOODL
#endif // USE_LIGHT