Browse Source

Add Shelly 1PM (#1822)

* Add Shelly 1PM

* Improve Shelly 1PM temperature tabs

* Add shelly 1pm button
master
Antonio López Marín 5 years ago
committed by Max Prokhorov
parent
commit
2e8ff3ab3d
3 changed files with 56 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +45
    -0
      code/espurna/config/hardware.h
  3. +10
    -0
      code/platformio.ini

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

@ -11,6 +11,7 @@
//#define ALLNET_4DUINO_IOT_WLAN_RELAIS
//#define ALLTERCO_SHELLY1
//#define ALLTERCO_SHELLY2
//#define ALLTERCO_SHELLY1PM
//#define ARILUX_AL_LC01
//#define ARILUX_AL_LC02
//#define ARILUX_AL_LC02_V14


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

@ -3103,6 +3103,51 @@
#define RELAY2_PIN 5
#define RELAY2_TYPE RELAY_TYPE_NORMAL
#elif defined(ALLTERCO_SHELLY1PM)
// Info
#define MANUFACTURER "ALLTERCO"
#define DEVICE "SHELLY1PM"
// Buttons
#define BUTTON1_PIN 4
#define BUTTON1_MODE BUTTON_SWITCH
#define BUTTON1_RELAY 1
#define BUTTON2_PIN 2
#define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON2_LNGCLICK BUTTON_MODE_RESET
#define BUTTON2_LNGLNGCLICK BUTTON_MODE_FACTORY
// Relays
#define RELAY1_PIN 15
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// Light
#define LED1_PIN 0
#define LED1_PIN_INVERSE 1
// HJL01 / BL0937
#ifndef HLW8012_SUPPORT
#define HLW8012_SUPPORT 1
#endif
#define HLW8012_SEL_PIN 12
#define HLW8012_CF1_PIN 13
#define HLW8012_CF_PIN 5
#define HLW8012_SEL_CURRENT LOW
#define HLW8012_CURRENT_RATIO 25740
#define HLW8012_VOLTAGE_RATIO 313400
#define HLW8012_POWER_RATIO 3414290
#define HLW8012_INTERRUPT_ON FALLING
//Temperature
#define NTC_SUPPORT 1
#define SENSOR_SUPPORT 1
#define NTC_BETA 3350
#define NTC_R_UP 10000
#define NTC_R_DOWN 0
#define NTC_R0 10000
// -----------------------------------------------------------------------------
#elif defined(LOHAS_9W)


+ 10
- 0
code/platformio.ini View File

@ -1384,6 +1384,16 @@ build_flags = ${common.build_flags_2m1m} -DALLTERCO_SHELLY2
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:allterco-shelly1pm]
board = ${common.board_2m}
build_flags = ${common.build_flags_2m1m} -DALLTERCO_SHELLY1PM
[env:allterco-shelly1pm-ota]
board = ${common.board_2m}
build_flags = ${common.build_flags_2m1m} -DALLTERCO_SHELLY1PM
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:xiaomi-smart-desk-lamp]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DXIAOMI_SMART_DESK_LAMP


Loading…
Cancel
Save