From f6ec2422a49f303658cd2d96fb6c3d14cab861a1 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Fri, 4 Sep 2020 22:08:28 +0200 Subject: [PATCH] hw: add support for the Zhilde ZLD-64EU-W (#2342) * Add support for the Zhilde ZLD-64EU-W This is a power outlet with 6 power sockets and 4 USB ports. * fixup based on the zld-44eu hw and tasmota template info Co-authored-by: Maxim Prokhorov --- code/espurna/config/arduino.h | 1 + code/espurna/config/hardware.h | 28 ++++++++++++++++++++++++++-- code/platformio.ini | 4 ++++ code/platformio_ota.ini | 3 +++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 755433dd..7782d68a 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -178,6 +178,7 @@ //#define YJZK_SWITCH_2CH //#define YJZK_SWITCH_3CH //#define ZHILDE_EU44_W +//#define ZHILDE_EU64_W //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 62b235da..ba8cc4d8 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -2757,6 +2757,32 @@ #define LED1_PIN 1 #define LED1_PIN_INVERSE 1 +// ----------------------------------------------------------------------------- +// Zhilde ZLD-64EU-W +// ----------------------------------------------------------------------------- + +#elif defined(ZHILDE_64EU_W) + + // Info + #define MANUFACTURER "ZHILDE" + #define DEVICE "64EU_W" + + // Based on https://templates.blakadder.com/ZLD64-EU-W.html , + // This product uses GPIO1 for LED and 3 for the button, so hardware serial should be disabled... + #define DEBUG_SERIAL_SUPPORT 0 + + #define BUTTON1_PIN 3 + #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH + #define BUTTON1_PRESS BUTTON_ACTION_NONE + #define BUTTON1_RELAY 3 + + #define RELAY1_PIN 5 + #define RELAY2_PIN 4 + #define RELAY3_PIN 14 + + #define LED1_PIN 1 + #define LED1_PIN_INVERSE 1 + // ----------------------------------------------------------------------------- // Allnet 4duino ESP8266-UP-Relais // http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/ @@ -4866,8 +4892,6 @@ #define LED1_PIN 2 #define LED1_PIN_INVERSE 1 -// ----------------------------------------------------------------------------- - #else #error "UNSUPPORTED HARDWARE!!" diff --git a/code/platformio.ini b/code/platformio.ini index a19d4cdd..b93ffc47 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -769,6 +769,10 @@ src_build_flags = -DARNIEX_SWIFITCH extends = env:esp8266-1m-base src_build_flags = -DZHILDE_EU44_W +[env:zhilde-64eu-w] +extends = env:esp8266-1m-base +src_build_flags = -DZHILDE_64EU_W + [env:luani-hvio] extends = env:esp8266-1m-base src_build_flags = -DLUANI_HVIO diff --git a/code/platformio_ota.ini b/code/platformio_ota.ini index 12798a68..65de4313 100644 --- a/code/platformio_ota.ini +++ b/code/platformio_ota.ini @@ -273,6 +273,9 @@ extends = env:arniex-swifitch [env:zhilde-eu44-w-ota] extends = env:zhilde-eu44-w +[env:zhilde-64eu-w-ota] +extends = env:zhilde-64eu-w + [env:luani-hvio-ota] extends = env:luani-hvio