diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 649dfa87..0d4481f3 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -82,6 +82,7 @@ //#define LUANI_HVIO //#define ALLNET_4DUINO_IOT_WLAN_RELAIS //#define TONBUX_MOSQUITO_KILLER +//#define NEO_COOLCAM_POWER_PLUG_WIFI //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index e3cc49ae..bb6cc9ef 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -2108,6 +2108,30 @@ #define LED4_PIN_INVERSE 0 #define LED4_RELAY 1 +// ----------------------------------------------------------------------------- +// NEO Coolcam Power Plug +// https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N +// ----------------------------------------------------------------------------- + +#elif defined(NEO_COOLCAM_POWER_PLUG_WIFI) + + // Info + #define MANUFACTURER "NEO_COOLCAM" + #define DEVICE "POWER_PLUG_WIFI" + + // Buttons + #define BUTTON1_PIN 13 + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + #define BUTTON1_RELAY 1 + + // Relays + #define RELAY1_PIN 12 + #define RELAY1_TYPE RELAY_TYPE_NORMAL + + // LEDs + #define LED1_PIN 4 + #define LED1_PIN_INVERSE 1 + // ----------------------------------------------------------------------------- // TEST boards (do not use!!) // ----------------------------------------------------------------------------- diff --git a/code/espurna/migrate.ino b/code/espurna/migrate.ino index 67d97c1f..9d38aa69 100644 --- a/code/espurna/migrate.ino +++ b/code/espurna/migrate.ino @@ -953,6 +953,16 @@ void migrate() { setSetting("relayGPIO", 0, 5); setSetting("relayType", 0, RELAY_TYPE_NORMAL); + #elif defined(NEO_COOLCAM_POWER_PLUG_WIFI) + + setSetting("board", 75); + setSetting("ledGPIO", 0, 4); + setSetting("ledLogic", 0, 1); + setSetting("btnGPIO", 0, 13); + setSetting("btnRelay", 0, 0); + setSetting("relayGPIO", 0, 12); + setSetting("relayType", 0, RELAY_TYPE_NORMAL); + #else // Allow users to define new settings without migration config diff --git a/code/platformio.ini b/code/platformio.ini index 0926af25..7cdba102 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1981,6 +1981,30 @@ upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 monitor_baud = 115200 extra_scripts = ${common.extra_scripts} +[env:neo-coolcam-power-plug-wifi] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags} -DNEO_COOLCAM_POWER_PLUG_WIFI +monitor_baud = 115200 +extra_scripts = ${common.extra_scripts} + +[env:neo-coolcam-power-plug-wifi-ota] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags} -DNEO_COOLCAM_POWER_PLUG_WIFI +upload_speed = 115200 +upload_port = "${env.ESPURNA_IP}" +upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 +extra_scripts = ${common.extra_scripts} + # ------------------------------------------------------------------------------ # GENERIC OTA ENVIRONMENTS # ------------------------------------------------------------------------------ @@ -2151,4 +2175,4 @@ build_flags = ${common.build_flags_1m} -DTONBUX_MOSQUITO_KILLER upload_speed = 115200 upload_port = "${env.ESPURNA_IP}" upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 -extra_scripts = ${common.extra_scripts} \ No newline at end of file +extra_scripts = ${common.extra_scripts}