Browse Source

Add etekcity-esw01-usa (#1836)

*  * Added support for Etekcity ESW01-USA device

* Update hardware.h

* Update hardware.h
master
Sandeep Sirpatil 4 years ago
committed by Max Prokhorov
parent
commit
6d74f4e958
2 changed files with 55 additions and 0 deletions
  1. +45
    -0
      code/espurna/config/hardware.h
  2. +10
    -0
      code/platformio.ini

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

@ -3741,6 +3741,51 @@
#define LED2_RELAY 1
#define LED2_MODE LED_MODE_FINDME_WIFI
// -----------------------------------------------------------------------------
// Etekcity ESW01-USA
// https://www.amazon.com/Etekcity-Voltson-Outlet-Monitoring-Required/dp/B01M3MYIFS
// -----------------------------------------------------------------------------
#elif defined(ETEKCITY_ESW01_USA)
// Info
#define MANUFACTURER "ETEKCITY"
#define DEVICE "ESW01-USA"
// Buttons
#define BUTTON1_PIN 14
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 4
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
// Blue
#define LED1_PIN 5
#define LED1_PIN_INVERSE 0
#define LED1_MODE LED_MODE_WIFI
// Yellow
#define LED2_PIN 16
#define LED2_PIN_INVERSE 0
#define LED2_MODE LED_MODE_FOLLOW
#define LED2_RELAY 1
// HLW8012
#ifndef HLW8012_SUPPORT
#define HLW8012_SUPPORT 1
#endif
#define HLW8012_SEL_PIN 15
#define HLW8012_CF1_PIN 12
#define HLW8012_CF_PIN 13
#define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current
#define HLW8012_CURRENT_R 0.001 // Current resistor
#define HLW8012_VOLTAGE_R_UP ( 4 * 470000 ) // Upstream voltage resistor
#define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor
#define HLW8012_INTERRUPT_ON CHANGE
// -----------------------------------------------------------------------------
// TEST boards (do not use!!)
// -----------------------------------------------------------------------------


+ 10
- 0
code/platformio.ini View File

@ -1543,3 +1543,13 @@ board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DJINVOO_VALVE_SM_AW713
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:etekcity-esw01-usa]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DETEKCITY_ESW01_USA
[env:etekcity-esw01-usa-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DETEKCITY_ESW01_USA
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}

Loading…
Cancel
Save