Browse Source

Support for KMC 70011 energy monitor (thanks to Wayne Manion, #598)

rfm69
Xose Pérez 6 years ago
parent
commit
22d82013d1
4 changed files with 71 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +32
    -0
      code/espurna/config/hardware.h
  3. +13
    -0
      code/espurna/migrate.ino
  4. +25
    -0
      code/platformio.ini

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

@ -54,6 +54,7 @@
//#define ARILUX_E27 //#define ARILUX_E27
//#define XENON_SM_PW702U //#define XENON_SM_PW702U
//#define AUTHOMETION_LYT8266 //#define AUTHOMETION_LYT8266
//#define KMC_70011
//#define GENERIC_8CH //#define GENERIC_8CH
//#define ARILUX_AL_LC01 //#define ARILUX_AL_LC01
//#define ARILUX_AL_LC11 //#define ARILUX_AL_LC11


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

@ -1364,6 +1364,38 @@
#define LIGHT_ENABLE_PIN 15 #define LIGHT_ENABLE_PIN 15
// -----------------------------------------------------------------------------
// KMC 70011
// https://www.amazon.com/KMC-Monitoring-Required-Control-Compatible/dp/B07313TH7B
// -----------------------------------------------------------------------------
#elif defined(KMC_70011)
// Info
#define MANUFACTURER "KMC"
#define DEVICE "70011"
// 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
// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 0
// HLW8012
#ifndef HLW8012_SUPPORT
#define HLW8012_SUPPORT 1
#endif
#define HLW8012_SEL_PIN 12
#define HLW8012_CF1_PIN 5
#define HLW8012_CF_PIN 4
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Generic 8CH // Generic 8CH
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


+ 13
- 0
code/espurna/migrate.ino View File

@ -698,6 +698,19 @@ void migrate() {
setSetting("chLogic", 3, 0); setSetting("chLogic", 3, 0);
setSetting("relays", 1); setSetting("relays", 1);
#elif defined(KMC_70011)
setSetting("board", 53);
setSetting("ledGPIO", 0, 13);
setSetting("ledLogic", 0, 0);
setSetting("btnGPIO", 0, 0);
setSetting("btnRelay", 0, 0);
setSetting("relayGPIO", 0, 14);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
setSetting("selGPIO", 12);
setSetting("cf1GPIO", 5);
setSetting("cfGPIO", 4);
#else #else
// Allow users to define new settings without migration config // Allow users to define new settings without migration config


+ 25
- 0
code/platformio.ini View File

@ -1386,6 +1386,31 @@ upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200 monitor_baud = 115200
extra_scripts = ${common.extra_scripts} extra_scripts = ${common.extra_scripts}
[env:kmc-70011]
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_1m} -DKMC_70011
monitor_baud = 115200
extra_scripts = ${common.extra_scripts}
[env:kmc-70011-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_1m} -DKMC_70011
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200
extra_scripts = ${common.extra_scripts}
[env:yjzk-switch-2ch] [env:yjzk-switch-2ch]
platform = ${common.platform} platform = ${common.platform}
framework = arduino framework = arduino


Loading…
Cancel
Save