diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 142712d3..decdb899 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -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 diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 2f696a7c..77c550e7 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -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-/ diff --git a/code/platformio.ini b/code/platformio.ini index dc6f1af3..e33f3f18 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -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 diff --git a/images/devices/kogan-smarter-home-plug-with-energy-meter.png b/images/devices/kogan-smarter-home-plug-with-energy-meter.png new file mode 100644 index 00000000..8f9f935b Binary files /dev/null and b/images/devices/kogan-smarter-home-plug-with-energy-meter.png differ