Browse Source

Add support for Hykker Smart Plug with power meter (#2010)

* add support for Hykker Smart Plug with power meter
Type: Power Plugs
Board: Hykker Power Plug
Build flag: HYKKER_POWER_PLUG
Description: Power plug w/ power metering

* Update arduino.h

hykker power plug

* Update platformio.ini

hykker power plug

* Type: Power Plugs
Board: Hykker Smart Home Power Plug
Build flag: HYKKER_SMART_HOME_POWER_PLUG
Description: Power plug w/ power metering

* voltage ratio calibration for correct results
master
reaper7 5 years ago
committed by Max Prokhorov
parent
commit
899f646f90
4 changed files with 56 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +45
    -0
      code/espurna/config/hardware.h
  3. +10
    -0
      code/platformio.ini
  4. BIN
      images/devices/hykker-smart-home-power-plug.jpg

+ 1
- 0
code/espurna/config/arduino.h View File

@ -55,6 +55,7 @@
//#define HOMECUBE_16A //#define HOMECUBE_16A
//#define HUACANXING_H801 //#define HUACANXING_H801
//#define HUACANXING_H802 //#define HUACANXING_H802
//#define HYKKER_SMART_HOME_POWER_PLUG
//#define IKE_ESPIKE //#define IKE_ESPIKE
//#define INTERMITTECH_QUINLED //#define INTERMITTECH_QUINLED
//#define ITEAD_1CH_INCHING //#define ITEAD_1CH_INCHING


+ 45
- 0
code/espurna/config/hardware.h View File

@ -4054,7 +4054,52 @@
#define LIGHT_CH3_INVERSE 0 #define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0 #define LIGHT_CH4_INVERSE 0
// -----------------------------------------------------------------------------
// Hykker Power Plug (Smart Home Series) available in Jernimo 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 #else


+ 10
- 0
code/platformio.ini View File

@ -1642,3 +1642,13 @@ board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DMUVIT_IO_MIOBULB001 build_flags = ${common.build_flags_1m0m} -DMUVIT_IO_MIOBULB001
upload_port = ${common.ota_upload_port} upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags} 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}

BIN
images/devices/hykker-smart-home-power-plug.jpg View File

Before After
Width: 400  |  Height: 400  |  Size: 40 KiB

Loading…
Cancel
Save