Browse Source

Deltaco smart home (#2103)

* add support for DELTACO SH-P01

* renaming deltaco_sh_le14w to deltaco_sh_lexxw

* add support Deltaco SH-P03USB and SH-LEXXRGB
mcspr-patch-1
orrpan 4 years ago
committed by Max Prokhorov
parent
commit
57a441a811
4 changed files with 204 additions and 0 deletions
  1. +4
    -0
      code/espurna/config/arduino.h
  2. +104
    -0
      code/espurna/config/hardware.h
  3. +56
    -0
      code/espurna/migrate.ino
  4. +40
    -0
      code/platformio.ini

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

@ -26,6 +26,10 @@
//#define BLITZWOLF_BWSHPX //#define BLITZWOLF_BWSHPX
//#define BLITZWOLF_BWSHPX_V23 //#define BLITZWOLF_BWSHPX_V23
//#define BLITZWOLF_BWSHP5 //#define BLITZWOLF_BWSHP5
//#define DELTACO_SH_LEXXW
//#define DELTACO_SH_LEXXRGB
//#define DELTACO_SH_P01
//#define DELTACO_SH_P03USB
//#define DIGOO_NX_SP202 //#define DIGOO_NX_SP202
//#define EHOMEDIY_WT02 //#define EHOMEDIY_WT02
//#define EHOMEDIY_WT03 //#define EHOMEDIY_WT03


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

@ -2831,6 +2831,64 @@
#define LED1_PIN_INVERSE 1 #define LED1_PIN_INVERSE 1
// -----------------------------------------------------------------------------
// Deltaco SH_P01 Wifi Smart Power Plug
// -----------------------------------------------------------------------------
#elif defined(DELTACO_SH_P01)
// Info
#define MANUFACTURER "DELTACO"
#define DEVICE "SH_P01"
// 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 5
#define LED1_PIN_INVERSE 1
#define LED1_MODE LED_MODE_FINDME
// ------------------------------------------------------------------------------
// DELTACO_SH_P03USB Wifi Smart Power Plug
// -----------------------------------------------------------------------------
#elif defined(DELTACO_SH_P03USB)
// Info
#define MANUFACTURER "DELTACO"
#define DEVICE "SH_P03USB"
// Buttons
#define BUTTON1_PIN 13
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH | BUTTON_SET_PULLUP
#define BUTTON1_RELAY 2
// Relays
#define RELAY1_PIN 15 // USB power
#define RELAY2_PIN 12 // power plug 1
#define RELAY3_PIN 14 // power plug 2
#define RELAY4_PIN 5 // power plug 3
#define RELAY1_TYPE RELAY_TYPE_NORMAL
#define RELAY2_TYPE RELAY_TYPE_NORMAL
#define RELAY3_TYPE RELAY_TYPE_NORMAL
#define RELAY4_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 0 // power led
#define LED1_PIN_INVERSE 1
#define LED1_MODE LED_MODE_FINDME
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Fornorm Wi-Fi USB Extension Socket (ZLD-34EU) // Fornorm Wi-Fi USB Extension Socket (ZLD-34EU)
// https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html // https://www.aliexpress.com/item/Fornorm-WiFi-Extension-Socket-with-Surge-Protector-Smart-Power-Strip-3-Outlets-and-4-USB-Charging/32849743948.html
@ -3621,6 +3679,52 @@
#define LIGHT_CH3_INVERSE 0 #define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0 #define LIGHT_CH4_INVERSE 0
// -----------------------------------------------------------------------------
// Deltaco white e14 (SH-LE14W) and e27 (SH-LE27W)
// -----------------------------------------------------------------------------
#elif defined(DELTACO_SH_LEXXW)
// Info
#define MANUFACTURER "DELTACO"
#define DEVICE "SH_LEXXW"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
// Light
#define LIGHT_CHANNELS 2
#define LIGHT_CH1_PIN 12 // WARM WHITE
#define LIGHT_CH2_PIN 14 // COLD WHITE
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
// -----------------------------------------------------------------------------
// Deltaco rgbw e27 (SH-LE27RGB)
// -----------------------------------------------------------------------------
#elif defined(DELTACO_SH_LEXXRGB)
// Info
#define MANUFACTURER "DELTACO"
#define DEVICE "SH_LEXXRGB"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
// Light
#define LIGHT_CHANNELS 5
#define LIGHT_CH1_PIN 5 // RED
#define LIGHT_CH2_PIN 4 // GREEN
#define LIGHT_CH3_PIN 13 // BLUE
#define LIGHT_CH4_PIN 14 // WARM WHITE
#define LIGHT_CH5_PIN 12 // COLD WHITE
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0
#define LIGHT_CH5_INVERSE 0
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Nexete A19 // Nexete A19
// https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201 // https://www.ebay.com/itm/Wifi-Smart-LED-light-Bulb-9W-60W-A19-850LM-RGBW-Dimmable-for-Alexa-Google-Home/283514779201


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

@ -1414,6 +1414,62 @@ void migrate() {
setSetting("chLogic", 3, 0); setSetting("chLogic", 3, 0);
setSetting("relays", 1); setSetting("relays", 1);
#elif defined(DELTACO_SH_P01)
setSetting("board", 105);
setSetting("ledGPIO", 0, 5);
setSetting("ledLogic", 0, 1);
setSetting("ledMode", 0, LED_MODE_FOLLOW);
setSetting("btnGPIO", 0, 13);
setSetting("btnRelay", 0, 0);
setSetting("relayGPIO", 0, 12);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
#elif defined(DELTACO_SH_P03USB)
setSetting("board", 106);
setSetting("btnGPIO", 0, 13);
setSetting("btnRelay", 0, 2);
setSetting("ledGPIO", 0, 0);
setSetting("ledLogic", 0, 1);
setSetting("ledMode", 0, LED_MODE_FINDME);
setSetting("relayGPIO", 0, 15);
setSetting("relayGPIO", 1, 12);
setSetting("relayGPIO", 2, 14);
setSetting("relayGPIO", 3, 5);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
setSetting("relayType", 2, RELAY_TYPE_NORMAL);
setSetting("relayType", 3, RELAY_TYPE_NORMAL);
#elif defined(DELTACO_SH_LEXXW)
setSetting("board", 107);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("chGPIO", 0, 12);
setSetting("chGPIO", 1, 14);
setSetting("chLogic", 0, 0);
setSetting("chLogic", 1, 0);
setSetting("relays", 1);
#elif defined(DELTACO_SH_LEXXRGB)
setSetting("board", 108);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("chGPIO", 0, 5);
setSetting("chGPIO", 1, 4);
setSetting("chGPIO", 2, 13);
setSetting("chGPIO", 3, 14);
setSetting("chGPIO", 4, 12);
setSetting("chLogic", 0, 0);
setSetting("chLogic", 1, 0);
setSetting("chLogic", 2, 0);
setSetting("chLogic", 3, 0);
setSetting("chLogic", 4, 0);
setSetting("relays", 1);
#else #else
// Allow users to define new settings without migration config // Allow users to define new settings without migration config


+ 40
- 0
code/platformio.ini View File

@ -1222,6 +1222,46 @@ build_flags = ${common.build_flags_1m0m} -DNEO_COOLCAM_NAS_WR01W
upload_port = ${common.ota_upload_port} upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags} upload_flags = ${common.ota_upload_flags}
[env:deltaco-sh-p01]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_P01
[env:deltaco-sh-p01-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_P01
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:deltaco-sh-p03usb]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_P03USB
[env:deltaco-sh-p03usb-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_P03USB
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:deltaco-sh-lexxw]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_LEXXW
[env:deltaco-sh-lexxw-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_LEXXW
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:deltaco-sh-lexxrgb]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_LEXXRGB
[env:deltaco-sh-lexxrgb-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DDELTACO_SH_LEXXRGB
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:estink-wifi-power-strip] [env:estink-wifi-power-strip]
board = ${common.board_1m} board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DFORNORM_ZLD_34EU build_flags = ${common.build_flags_1m0m} -DFORNORM_ZLD_34EU


Loading…
Cancel
Save