diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 8895c237..81ef258e 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -55,6 +55,7 @@ //#define HOMECUBE_16A //#define HUACANXING_H801 //#define HUACANXING_H802 +//#define HYKKER_SMART_HOME_POWER_PLUG //#define IKE_ESPIKE //#define INTERMITTECH_QUINLED //#define ITEAD_1CH_INCHING diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index ffca25c5..238597ac 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -4054,7 +4054,52 @@ #define LIGHT_CH3_INVERSE 0 #define LIGHT_CH4_INVERSE 0 +// ----------------------------------------------------------------------------- +// Hykker Power Plug (Smart Home Series) available in Jer—nimo Martins Polska (Biedronka) +// https://www.hykker.com/akcesoria/gniazdo-wi-fi-z-licznikiem-energii/ +// Reflashing from original Tuya firmware +// to thirdparty firmware like espurna by: +// https://github.com/ct-Open-Source/tuya-convert +// ----------------------------------------------------------------------------- + +#elif defined(HYKKER_SMART_HOME_POWER_PLUG) + + // Info + #define MANUFACTURER "HYKKER" + #define DEVICE "SMART_HOME_POWER_PLUG" + + // Buttons + #define BUTTON1_PIN 0 + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + #define BUTTON1_RELAY 1 + + // Relays + #define RELAY1_PIN 14 + #define RELAY1_TYPE RELAY_TYPE_NORMAL + + // LED + // Red + #define LED1_PIN 13 + #define LED1_MODE LED_MODE_WIFI + #define LED1_PIN_INVERSE 1 + // Blue connected to relay + + // HLW8012 + #ifndef HLW8012_SUPPORT + #define HLW8012_SUPPORT 1 + #endif + #define HLW8012_SEL_PIN 12 + #define HLW8012_CF1_PIN 5 + #define HLW8012_CF_PIN 4 + + #define HLW8012_SEL_CURRENT LOW + #define HLW8012_CURRENT_RATIO 25740 + #define HLW8012_VOLTAGE_RATIO 282060 + #define HLW8012_POWER_RATIO 3414290 + #define HLW8012_INTERRUPT_ON FALLING + #define SENSOR_ENERGY_UNITS ENERGY_KWH + #define SENSOR_POWER_UNITS POWER_WATTS // ----------------------------------------------------------------------------- #else diff --git a/code/platformio.ini b/code/platformio.ini index ae3c4497..067f22bc 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1642,3 +1642,13 @@ board = ${common.board_1m} build_flags = ${common.build_flags_1m0m} -DMUVIT_IO_MIOBULB001 upload_port = ${common.ota_upload_port} upload_flags = ${common.ota_upload_flags} + +[env:hykker-smart-home-power-plug] +board = ${common.board_1m} +build_flags = ${common.build_flags_1m0m} -DHYKKER_SMART_HOME_POWER_PLUG + +[env:hykker-smart-home-power-plug-ota] +board = ${common.board_1m} +build_flags = ${common.build_flags_1m0m} -DHYKKER_SMART_HOME_POWER_PLUG +upload_port = ${common.ota_upload_port} +upload_flags = ${common.ota_upload_flags} diff --git a/images/devices/hykker-smart-home-power-plug.jpg b/images/devices/hykker-smart-home-power-plug.jpg new file mode 100644 index 00000000..d7d6a4ad Binary files /dev/null and b/images/devices/hykker-smart-home-power-plug.jpg differ