Prep Shelly Pro EM support

This commit is contained in:
Theo Arends
2026-03-31 14:25:09 +02:00
parent 74099b54e3
commit 7db333010b
2 changed files with 146 additions and 139 deletions
+6 -6
View File
@@ -7,7 +7,7 @@ Using command ``I2cDriver`` individual drivers can be enabled or disabled at run
The following table lists the supported I2C devices
Index | Define | Driver | Device | Address(es) | Bus2 | Description
------|---------------------|----------|----------|-------------|------|-----------------------------------------------
------|---------------------|----------|-----------|--------------------------|------|-----------------------------------------------
1 | USE_PCA9685 | xdrv_15 | PCA9685 | 0x40 - 0x47 | Yes | 16-channel 12-bit pwm driver
1 | USE_PCA9685_V2 | xdrv_15 | PCA9685 | 0x40 - 0x47 | Yes | 16-channel 12-bit pwm driver
2 | USE_PCF8574 | xdrv_28 | PCF8574 | 0x20 - 0x26 | Yes | 8-bit I/O expander (address range overridable)
@@ -30,7 +30,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
11 | USE_BH1750 | xsns_10 | BH1750 | 0x23, 0x5C | Yes | Ambient light intensity sensor
12 | USE_VEML6070 | xsns_11 | VEML6070 | 0x38 - 0x39 | | Ultra violet light intensity sensor
13 | USE_ADS1115 | xsns_12 | ADS1115 | 0x48 - 0x4B | Yes | 4-channel 16-bit A/D converter
14 | USE_INA219 | xsns_13 | INA219 | 0x40 - 0x41, 0x44 - 0x45 | | Low voltage current sensor
14 | USE_INA219 | xsns_13 | INA219 | 0x40, 0x41, 0x44, 0x45 | | Low voltage current sensor
15 | USE_SHT3X | xsns_14 | SHT3X | 0x44 - 0x45 | Yes | Temperature and Humidity sensor
15 | USE_SHT3X | xsns_14 | SHT4X | 0x44 - 0x46 | Yes | Temperature and Humidity sensor
15 | USE_SHT3X | xsns_14 | SHTCX | 0x70 | Yes | Temperature and Humidity sensor
@@ -58,7 +58,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
32 | USE_MLX90614 | xsns_46 | MLX90614 | 0x5A | | Infra red temperature sensor
33 | USE_CHIRP | xsns_48 | CHIRP | 0x20 | | Soil moisture sensor
34 | USE_PAJ7620 | xsns_50 | PAJ7620 | 0x73 | | Gesture sensor
35 | USE_INA226 | xsns_54 | INA226 | 0x40 - 0x41, 0x44 - 0x45 | | Low voltage current sensor
35 | USE_INA226 | xsns_54 | INA226 | 0x40, 0x41, 0x44, 0x45 | | Low voltage current sensor
36 | USE_HIH6 | xsns_55 | HIH6130 | 0x27 | | Temperature and Humidity sensor
37 | USE_24C256 | xdrv_10 | 24C256 | 0x50 | | Scripter EEPROM storage
38 | USE_DISPLAY_ILI9488 | xdsp_08 | FT6236 | 0x38 | | Touch panel controller
@@ -96,7 +96,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
56 | USE_SEESAW_SOIL | xsns_81 | SEESOIL | 0x36 - 0x39 | | Adafruit Seesaw soil moisture & temp sensor
56 | USE_SEESAW_ENCODER | xsns_81 | SEEENC | 0x36 - 0x39 | | Adafruit Seesaw rotary encoder
57 | USE_TOF10120 | xsns_84 | TOF10120 | 0x52 | | Time-of-flight (ToF) distance sensor
58 | USE_MPU_ACCEL | xsns_85 | MPU_ACCEL| 0x68 | Yes | MPU6886/MPU9250 6-axis MotionTracking sensor from M5Stack
58 | USE_MPU_ACCEL | xsns_85 | MPU_ACCEL | 0x68 | Yes | MPU6886/MPU9250 6-axis MotionTracking sensor from M5Stack
59 | USE_BM8563 | xdrv_56 | BM8563 | 0x51 | Yes | BM8563 RTC from M5Stack
60 | USE_AM2320 | xsns_88 | AM2320 | 0x5C | | Temperature and Humidity sensor
61 | USE_T67XX | xsns_89 | T67XX | 0x15 | | CO2 sensor
@@ -115,7 +115,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
74 | USE_DISPLAY_TM1650 | xdsp_20 | TM1650 | 0x24 - 0x27, 0x34 - 0x37 | | Four-digit seven-segment LED controller
75 | USE_PCA9632 | xdrv_64 | PCA9632 | 0x60 | | 4-channel 4-bit pwm driver
76 | USE_SEN5X | xsns_103 | SEN5X | 0x69 | Yes | Gas (VOC/NOx index) and air quality (PPM <1,<2.5,<4,<10)
77 | USE_MCP23XXX_DRV | xdrv_67 | MCP23x17 | 0x20 - 0x26 | | 16-bit I/O expander as virtual button/switch/relay
77 | USE_MCP23XXX_DRV | xdrv_67 | MCP23x17 | 0x20 - 0x26 | Yes | 16-bit I/O expander as virtual button/switch/relay
78 | USE_PMSA003I | xsns_104 | PMSA003I | 0x12 | | PM2.5 Air Quality Sensor with I2C Interface
79 | USE_GDK101 | xsns_106 | GDK101 | 0x18 - 0x1B | Yes | Gamma Radiation Sensor
80 | USE_TC74 | xsns_108 | TC74 | 0x48 - 0x4F | | Temperature sensor
@@ -138,7 +138,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
95 | USE_AGS02MA | xsns_118 | AGS02MA | 0x1A | | TVOC Gas sensor
96 | USE_RX8025 | xdrv_56 | RX8025 | 0x32 | Yes | RX8025 RTC
97 | USE_SEN6X | xsns_119 | SEN6X | 0x6B | Yes | Gas (CO2/VOC/NOx index) and air quality (PPM <1,<2.5,<4,<10)
98 | USE_FM24CXX | xdrv_93 | FM24CXX | 0x50 - 0x57| Yes | FM24CXX - External FRAM with console / berry R/W operations
98 | USE_FM24CXX | xdrv_93 | FM24CXX | 0x50 - 0x57 | Yes | FM24CXX - External FRAM with console / berry R/W operations
99 | USE_STCC4 | xsns_120 | STCC4 | 0x64, 0x65 | Yes | CO2 and optional temperature and humidity sensor
NOTE: Bus2 is supported on ESP8266, ESP32, ESP32-C6, ESP32-H2, ESP32-P4, ESP32-S2 and ESP32-S3
@@ -40,10 +40,12 @@
* Model differences:
* Function Model1 Model2 Model3 Model4 Model5 Model6 Remark
* ------------------------------ ------- ------- ------- ------ ------ ------ -------------------------------------------------
* Shelly 2.5 EM Plus2PM Pro1PM Pro2PM Pro4PM Shelly hardware
* 2PMGen3
* Processor ESP8266 ESP8266 ESP32 ESP32 ESP32 ESP32
* ESP32C3 Shelly Gen3
* Shelly Gen1 2.5 EM - - - -
* Shelly Gen2 - ProEM Plus2PM Pro1PM Pro2PM Pro4PM
* Shelly Gen3 - - 2PMGen3 - - -
* Processor Gen1 ESP8266 ESP8266 - - - -
* Processor Gen2 - ESP32 ESP32 ESP32 ESP32 ESP32
* Processor Gen3 - - ESP32C3 - - -
* Interface I2C I2C I2C SPI SPI SPI Interface type used
* Number of inputs 2 2 2 1 2 4 Count of ADE9753 inputs used
* Number of ADE9753 chips 1 1 1 1 2 2 Count of ADE9753 chips
@@ -728,9 +730,14 @@ void Ade7953DrvInit(void) {
pinMode(pin_reset, OUTPUT); // Reset pin ADE7953
delay(1); // To initiate a hardware reset, this pin must be brought low for a minimum of 10 μs.
digitalWrite(pin_reset, 1);
/*
if (Ade7953.model < ADE7953_SHELLY_PRO_1PM) {
pinMode(pin_reset, INPUT);
pinMode(pin_reset, INPUT); // Reduce current on this pin lowering temperature considerably
}
*/
#if defined(ESP8266) || defined(CONFIG_IDF_TARGET_ESP32C3) // Only ESP8266 (Gen1) and ESP32-C3 (Gen3) benefit from this
pinMode(pin_reset, INPUT); // Reduce current on this pin lowering temperature considerably
#endif
}
#ifdef USE_ESP32_SPI
#if (defined(USE_SHELLY_PRO) && defined(USE_MCP23XXX_DRV)) || defined(USE_SHELLY_PRO_V2)