Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Kogan Smarter Home Plug With Energy Meter #2086

Merged
merged 7 commits into from
Jan 13, 2020
Merged
1 change: 1 addition & 0 deletions code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
//#define JINVOO_VALVE_SM_AW713
//#define JORGEGARCIA_WIFI_RELAYS
//#define KMC_70011
//#define KOGAN_SMARTER_HOME_PLUG_W_POW
//#define LINGAN_SWA1
//#define LINKSPRITE_LINKNODE_R4
//#define LITESUN_LA_WF3
Expand Down
48 changes: 48 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -4211,6 +4211,54 @@
#define SENSOR_ENERGY_UNITS ENERGY_KWH
#define SENSOR_POWER_UNITS POWER_WATTS

// -----------------------------------------------------------------------------
// Kogan Smarter Home Plug with Energy Meter (Australia)
// Product code: KASPEMHA
// https://www.kogan.com/au/buy/kogan-smarterhome-smart-plug-energy-meter/
// Reflashing from original Tuya firmware
// to thirdparty firmware like espurna by:
// https://github.com/ct-Open-Source/tuya-convert
// -----------------------------------------------------------------------------

#elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)

// Info
#define MANUFACTURER "KOGAN"
#define DEVICE "SMARTER_HOME_PLUG_W_POW"

// Buttons
#define BUTTON1_PIN 0
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
#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

// -----------------------------------------------------------------------------
// LSC Smart LED Light Strip (Smart CXonnect Series) available ACTION (Germany)
// https://www.action.com/de-de/p/lsc-smart-connect-intelligenter-multicolor-led-strip-/
Expand Down
10 changes: 10 additions & 0 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,16 @@ build_flags = ${common.build_flags_1m0m} -DHYKKER_SMART_HOME_POWER_PLUG
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}

[env:kogan-smarter-home-plug-w-pow]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DKOGAN_SMARTER_HOME_PLUG_W_POW

[env:kogan-smarter-home-plug-w-pow-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DKOGAN_SMARTER_HOME_PLUG_W_POW
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}

[env:lsc-smart-led-light-strip]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DLSC_SMART_LED_LIGHT_STRIP
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.