diff --git a/CHANGELOG.md b/CHANGELOG.md index ad1a2401b..9efb3c2a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ All notable changes to this project will be documented in this file. - Letsencrypt R3 in addition to X3 CA (#10086) - Zigbee add visual map of network - Command ``SetOption117 1`` for light fading to be fixed duration instead of fixed slew rate (#10109) -- ESP32 SPIFFS support +- Support ESP32 SPIFFS for internal use ### Breaking Changed - KNX DPT9 (16-bit float) to DPT14 (32-bit float) by Adrian Scillato (#9811, #9888) @@ -46,8 +46,11 @@ All notable changes to this project will be documented in this file. - Backlog timing wraparound (#9995) - First LED in addressable string does not fade when using scheme (#10088) - Improved Opentherm error handling (#10055) +- Platformio compiler option `no target align` removed fixing hardware watchdog exceptions - Shutter motordelay stop issue (#10033) +- Shutter fix overflow on runtime over 100 seconds (#9800) - ESP32 CC2530 heap corruption (#10121) +- ESP32 Analog input div10 rule trigger (#10149) ### Removed - PN532 define USE_PN532_CAUSE_EVENTS replaced by generic rule trigger `on pn532#uid=` diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ec017703b..32c31dfbf 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -30,7 +30,7 @@ Support of Core versions before 2.7.1 has been removed. ## Support of TLS -To save resources when TLS is enabled mDNS needs to be disabled. In addition to TLS using fingerprints now also user supplied CA certs and AWS IoT is supported. Read [full documentation](https://tasmota.github.io/docs/AWS-IoT) +In addition to TLS using fingerprints now also user supplied CA certs and AWS IoT is supported. Read [full documentation](https://tasmota.github.io/docs/AWS-IoT) ## Initial configuration tools @@ -77,11 +77,11 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Support for common anode sevenseg displays by adding ``#define USE_DISPLAY_SEVENSEG_COMMON_ANODE`` by Ken Sanislo (#9963) - Support for multiple WeMo devices by Magic73 (#9208) - Support for SPI connected MFRC522 13.56MHz rfid card reader (#9916) +- Support ESP32 SPIFFS for internal use - KNX read reply for Power (#9236, #9891) - Fallback NTP server from x.pool.ntp.org if no ntpservers are configured - Optional CCloader support for CC25xx Zigbee or CC26xx BLE by Christian Baars (#9970) - Letsencrypt R3 in addition to X3 CA (#10086) -- ESP32 SPIFFS support ### Breaking Changed - KNX DPT9 (16-bit float) to DPT14 (32-bit float) by Adrian Scillato (#9811, #9888) @@ -91,7 +91,6 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - IRremoteESP8266 library from v2.7.12 to v2.7.13 - Shelly Dimmer 1 and 2 stm32 firmware from v51.4 to v51.5 - mDNS has been disabled from all pre-compiled binaries to allow new features -- Platformio compiler option `no target align` enabled (#9749) - Sonoff L1 color up scaling and color margin detection (#9545) - MQTT Wifi connection timeout from 5000 to 200 mSec (#9886) - Force bigger Thunk Stack if 4K RSA even without EC ciphers (#10075) @@ -109,7 +108,9 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - First LED in addressable string does not fade when using scheme (#10088) - Improved Opentherm error handling (#10055) - Shutter motordelay stop issue (#10033) +- Shutter fix overflow on runtime over 100 seconds (#9800) - ESP32 CC2530 heap corruption (#10121) +- ESP32 Analog input div10 rule trigger (#10149) ### Removed - Version compatibility check diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 4b9e21839..099d4f468 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -1154,11 +1154,15 @@ void CmndGpio(void) TasmotaGlobal.restart_flag = 2; } } - Response_P(PSTR("{")); bool jsflg = false; + bool jsflg2 = false; for (uint32_t i = 0; i < ARRAY_SIZE(Settings.my_gp.io); i++) { if (ValidGPIO(i, template_gp.io[i]) || ((255 == XdrvMailbox.payload) && !FlashPin(i))) { - if (jsflg) { ResponseAppend_P(PSTR(",")); } + if (!jsflg) { + Response_P(PSTR("{")); + } else { + ResponseAppend_P(PSTR(",")); + } jsflg = true; uint32_t sensor_type = Settings.my_gp.io[i]; if (!ValidGPIO(i, template_gp.io[i])) { @@ -1183,12 +1187,16 @@ void CmndGpio(void) sensor_names = kSensorNamesFixed; } char stemp1[TOPSZ]; - ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%d\":\"%s%s\"}"), - i, sensor_type, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names), sindex); + if ((ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%d\":\"%s%s\"}"), i, sensor_type, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names), sindex) > (LOGSZ - TOPSZ)) || (i == ARRAY_SIZE(Settings.my_gp.io) -1)) { + ResponseJsonEndEnd(); + MqttPublishPrefixTopic_P(RESULT_OR_STAT, XdrvMailbox.command); + jsflg2 = true; + jsflg = false; + } } } - if (jsflg) { - ResponseJsonEnd(); + if (jsflg2) { + ResponseClear(); } else { ResponseCmndChar(D_JSON_NOT_SUPPORTED); } @@ -2068,6 +2076,9 @@ void CmndDriver(void) void CmndInfo(void) { NvsInfo(); +#ifdef USE_TFS + TfsInfo(); +#endif ResponseCmndDone(); } diff --git a/tasmota/support_esp32.ino b/tasmota/support_esp32.ino index 806175505..2f544ba5e 100644 --- a/tasmota/support_esp32.ino +++ b/tasmota/support_esp32.ino @@ -194,8 +194,8 @@ void QPCWrite(const void *pSettings, unsigned nSettingsLen) { void NvsInfo(void) { nvs_stats_t nvs_stats; nvs_get_stats(NULL, &nvs_stats); - AddLog_P(LOG_LEVEL_INFO, PSTR("INF: NVS Used %d, Free %d, Total %d, Namspaces %d"), - nvs_stats.used_entries, nvs_stats.free_entries, nvs_stats.total_entries, nvs_stats.namespace_count); + AddLog_P(LOG_LEVEL_INFO, PSTR("NVS: Used %d/%d entries, NameSpaces %d"), + nvs_stats.used_entries, nvs_stats.total_entries, nvs_stats.namespace_count); } void ZigbeeErase(unsigned nSettingsLen) { diff --git a/tasmota/support_filesystem.ino b/tasmota/support_filesystem.ino index 6eef715f4..94b69fea2 100644 --- a/tasmota/support_filesystem.ino +++ b/tasmota/support_filesystem.ino @@ -23,15 +23,9 @@ #ifdef ESP32 -#define USE_TFS - -#ifdef USE_SCRIPT -#undef USE_TFS -#endif // USE_SCRIPT - #ifdef USE_TFS -//#define USE_LITTLEFS // LittleFS not tested yet +//#define USE_LITTLEFS // LittleFS not tested yet as currently ESP8266 only //#define USE_FFAT // FFat minimal 983k partition (4096 sector size) - tested #define USE_SPIFFS // SPIFFS - tested @@ -64,7 +58,6 @@ bool TfsInit(void) { } } AddLog_P(LOG_LEVEL_INFO, PSTR("TFS: Mounted")); -// TfsInfo(); FsMounted = 2; // true return true; } @@ -130,10 +123,12 @@ bool TfsLoadFile(const char *fname, uint8_t *buf, uint32_t len) { } void TfsInfo(void) { + if (!TfsInit()) { return; } + + uint32_t total_bytes = TASMOTA_FS.totalBytes(); #ifdef USE_SPIFFS uint32_t used_bytes = TASMOTA_FS.usedBytes(); #endif // USE_SPIFFS - uint32_t total_bytes = TASMOTA_FS.totalBytes(); #ifdef USE_FFAT uint32_t used_bytes = total_bytes - TASMOTA_FS.freeBytes(); #endif // USE_FFAT diff --git a/tasmota/tasmota_globals.h b/tasmota/tasmota_globals.h index fc2fbf34d..3ca9923e0 100644 --- a/tasmota/tasmota_globals.h +++ b/tasmota/tasmota_globals.h @@ -107,6 +107,12 @@ String EthernetMacAddress(void); #define ARDUINO_CORE_RELEASE ARDUINO_ESP32_RELEASE #endif // ARDUINO_ESP32_RELEASE +#define USE_TFS + +#ifdef USE_SCRIPT +#undef USE_TFS +#endif // USE_SCRIPT + // Hardware has no ESP32 #undef USE_TUYA_DIMMER #undef USE_PWM_DIMMER diff --git a/tasmota/xdrv_23_zigbee_5__constants.ino b/tasmota/xdrv_23_zigbee_5__constants.ino index 5cc62720c..dd7e9234c 100644 --- a/tasmota/xdrv_23_zigbee_5__constants.ino +++ b/tasmota/xdrv_23_zigbee_5__constants.ino @@ -275,6 +275,11 @@ const char Z_strings[] PROGMEM = "ValvePosition" "\x00" "EurotronicErrors" "\x00" "CurrentTemperatureSetPoint" "\x00" + "EurotronicHostFlags" "\x00" + "TRVMirrorDisplay" "\x00" + "TRVBoost" "\x00" + "TRVWindowOpen" "\x00" + "TRVChildProtection" "\x00" "ThSetpoint" "\x00" "TempTarget" "\x00" "Hue" "\x00" @@ -691,218 +696,223 @@ enum Z_offsets { Zo_ValvePosition = 3473, Zo_EurotronicErrors = 3487, Zo_CurrentTemperatureSetPoint = 3504, - Zo_ThSetpoint = 3531, - Zo_TempTarget = 3542, - Zo_Hue = 3553, - Zo_Sat = 3557, - Zo_RemainingTime = 3561, - Zo_X = 3575, - Zo_Y = 3577, - Zo_DriftCompensation = 3579, - Zo_CompensationText = 3597, - Zo_CT = 3614, - Zo_ColorMode = 3617, - Zo_NumberOfPrimaries = 3627, - Zo_Primary1X = 3645, - Zo_Primary1Y = 3655, - Zo_Primary1Intensity = 3665, - Zo_Primary2X = 3683, - Zo_Primary2Y = 3693, - Zo_Primary2Intensity = 3703, - Zo_Primary3X = 3721, - Zo_Primary3Y = 3731, - Zo_Primary3Intensity = 3741, - Zo_WhitePointX = 3759, - Zo_WhitePointY = 3771, - Zo_ColorPointRX = 3783, - Zo_ColorPointRY = 3796, - Zo_ColorPointRIntensity = 3809, - Zo_ColorPointGX = 3830, - Zo_ColorPointGY = 3843, - Zo_ColorPointGIntensity = 3856, - Zo_ColorPointBX = 3877, - Zo_ColorPointBY = 3890, - Zo_ColorPointBIntensity = 3903, - Zo_Illuminance = 3924, - Zo_IlluminanceMinMeasuredValue = 3936, - Zo_IlluminanceMaxMeasuredValue = 3964, - Zo_IlluminanceTolerance = 3992, - Zo_IlluminanceLightSensorType = 4013, - Zo_IlluminanceLevelStatus = 4040, - Zo_IlluminanceTargetLevel = 4063, - Zo_Temperature = 4086, - Zo_TemperatureMinMeasuredValue = 4098, - Zo_TemperatureMaxMeasuredValue = 4126, - Zo_TemperatureTolerance = 4154, - Zo_Pressure = 4175, - Zo_PressureMinMeasuredValue = 4184, - Zo_PressureMaxMeasuredValue = 4209, - Zo_PressureTolerance = 4234, - Zo_PressureScaledValue = 4252, - Zo_PressureMinScaledValue = 4272, - Zo_PressureMaxScaledValue = 4295, - Zo_PressureScaledTolerance = 4318, - Zo_PressureScale = 4342, - Zo_SeaPressure = 4356, - Zo_FlowRate = 4368, - Zo_FlowMinMeasuredValue = 4377, - Zo_FlowMaxMeasuredValue = 4398, - Zo_FlowTolerance = 4419, - Zo_Humidity = 4433, - Zo_HumidityMinMeasuredValue = 4442, - Zo_HumidityMaxMeasuredValue = 4467, - Zo_HumidityTolerance = 4492, - Zo_Occupancy = 4510, - Zo_OccupancySensorType = 4520, - Zo_ZoneState = 4540, - Zo_ZoneType = 4550, - Zo_ZoneStatus = 4559, - Zo_CIE = 4570, - Zo_Contact = 4574, - Zo_Fire = 4582, - Zo_Water = 4587, - Zo_CO = 4593, - Zo_PersonalAlarm = 4596, - Zo_Movement = 4610, - Zo_Panic = 4619, - Zo_GlassBreak = 4625, - Zo_EnergyTotal = 4636, - Zo_CompanyName = 4648, - Zo_MeterTypeID = 4660, - Zo_DataQualityID = 4672, - Zo_CustomerName = 4686, - Zo_Model = 4699, - Zo_PartNumber = 4705, - Zo_ProductRevision = 4716, - Zo_SoftwareRevision = 4732, - Zo_UtilityName = 4749, - Zo_POD = 4761, - Zo_AvailablePower = 4765, - Zo_PowerThreshold = 4780, - Zo_RMSVoltage = 4795, - Zo_RMSCurrent = 4806, - Zo_ActivePower = 4817, - Zo_ReactivePower = 4829, - Zo_ApparentPower = 4843, - Zo_NumberOfResets = 4857, - Zo_PersistentMemoryWrites = 4872, - Zo_LastMessageLQI = 4895, - Zo_LastMessageRSSI = 4910, - Zo_TuyaScheduleWorkdays = 4926, - Zo_TuyaScheduleHolidays = 4947, - Zo_Power2 = 4968, - Zo_Power3 = 4975, - Zo_Power4 = 4982, - Zo_TuyaChildLock = 4989, - Zo_TuyaWindowDetection = 5003, - Zo_TuyaValveDetection = 5023, - Zo_TuyaAutoLock = 5042, - Zo_TuyaTempTarget = 5055, - Zo_TuyaBattery = 5070, - Zo_TuyaMinTemp = 5082, - Zo_TuyaMaxTemp = 5094, - Zo_TuyaBoostTime = 5106, - Zo_TuyaComfortTemp = 5120, - Zo_TuyaEcoTemp = 5136, - Zo_TuyaValvePosition = 5148, - Zo_TuyaAwayTemp = 5166, - Zo_TuyaAwayDays = 5179, - Zo_TuyaPreset = 5192, - Zo_TuyaFanMode = 5203, - Zo_TuyaForceMode = 5215, - Zo_TuyaWeekSelect = 5229, - Zo_OppleMode = 5244, - Zo_TerncyDuration = 5254, - Zo_TerncyRotate = 5269, - Zo_Identify = 5282, - Zo_xxxx = 5291, - Zo_IdentifyQuery = 5296, - Zo_AddGroup = 5310, - Zo_xxxx00 = 5319, - Zo_ViewGroup = 5326, - Zo_GetGroup = 5336, - Zo_01xxxx = 5345, - Zo_GetAllGroups = 5352, - Zo_00 = 5365, - Zo_RemoveGroup = 5368, - Zo_RemoveAllGroups = 5380, - Zo_ViewScene = 5396, - Zo_xxxxyy = 5406, - Zo_RemoveScene = 5413, - Zo_RemoveAllScenes = 5425, - Zo_RecallScene = 5441, - Zo_GetSceneMembership = 5453, - Zo_PowerOffEffect = 5472, - Zo_xxyy = 5487, - Zo_PowerOnRecall = 5492, - Zo_PowerOnTimer = 5506, - Zo_xxyyyyzzzz = 5519, - Zo_xx0A00 = 5530, - Zo_DimmerUp = 5537, - Zo_00190200 = 5546, - Zo_DimmerDown = 5555, - Zo_01190200 = 5566, - Zo_DimmerStop = 5575, - Zo_ResetAlarm = 5586, - Zo_xxyyyy = 5597, - Zo_ResetAllAlarms = 5604, - Zo_xx000A00 = 5619, - Zo_HueSat = 5628, - Zo_xxyy0A00 = 5635, - Zo_Color = 5644, - Zo_xxxxyyyy0A00 = 5650, - Zo_xxxx0A00 = 5663, - Zo_ShutterOpen = 5672, - Zo_ShutterClose = 5684, - Zo_ShutterStop = 5697, - Zo_ShutterLift = 5709, - Zo_xx = 5721, - Zo_ShutterTilt = 5724, - Zo_Shutter = 5736, - Zo_DimmerMove = 5744, - Zo_xx0A = 5755, - Zo_DimmerStepUp = 5760, - Zo_00xx0A00 = 5773, - Zo_DimmerStepDown = 5782, - Zo_01xx0A00 = 5797, - Zo_DimmerStep = 5806, - Zo_xx190A00 = 5817, - Zo_01 = 5826, - Zo_HueMove = 5829, - Zo_xx19 = 5837, - Zo_HueStepUp = 5842, - Zo_HueStepDown = 5852, - Zo_03xx0A00 = 5864, - Zo_HueStep = 5873, - Zo_SatMove = 5881, - Zo_SatStep = 5889, - Zo_xx190A = 5897, - Zo_ColorMove = 5904, - Zo_xxxxyyyy = 5914, - Zo_ColorStep = 5923, - Zo_ColorTempMoveUp = 5933, - Zo_01xxxx000000000000 = 5949, - Zo_ColorTempMoveDown = 5968, - Zo_03xxxx000000000000 = 5986, - Zo_ColorTempMoveStop = 6005, - Zo_00xxxx000000000000 = 6023, - Zo_ColorTempMove = 6042, - Zo_xxyyyy000000000000 = 6056, - Zo_ColorTempStepUp = 6075, - Zo_01xxxx0A0000000000 = 6091, - Zo_ColorTempStepDown = 6110, - Zo_03xxxx0A0000000000 = 6128, - Zo_ColorTempStep = 6147, - Zo_xxyyyy0A0000000000 = 6161, - Zo_ArrowClick = 6180, - Zo_ArrowHold = 6191, - Zo_ArrowRelease = 6201, - Zo_ZoneStatusChange = 6214, - Zo_xxxxyyzz = 6231, - Zo_xxyyzzzz = 6240, - Zo_AddScene = 6249, - Zo_xxyyyyzz = 6258, - Zo_StoreScene = 6267, + Zo_EurotronicHostFlags = 3531, + Zo_TRVMirrorDisplay = 3551, + Zo_TRVBoost = 3568, + Zo_TRVWindowOpen = 3577, + Zo_TRVChildProtection = 3591, + Zo_ThSetpoint = 3610, + Zo_TempTarget = 3621, + Zo_Hue = 3632, + Zo_Sat = 3636, + Zo_RemainingTime = 3640, + Zo_X = 3654, + Zo_Y = 3656, + Zo_DriftCompensation = 3658, + Zo_CompensationText = 3676, + Zo_CT = 3693, + Zo_ColorMode = 3696, + Zo_NumberOfPrimaries = 3706, + Zo_Primary1X = 3724, + Zo_Primary1Y = 3734, + Zo_Primary1Intensity = 3744, + Zo_Primary2X = 3762, + Zo_Primary2Y = 3772, + Zo_Primary2Intensity = 3782, + Zo_Primary3X = 3800, + Zo_Primary3Y = 3810, + Zo_Primary3Intensity = 3820, + Zo_WhitePointX = 3838, + Zo_WhitePointY = 3850, + Zo_ColorPointRX = 3862, + Zo_ColorPointRY = 3875, + Zo_ColorPointRIntensity = 3888, + Zo_ColorPointGX = 3909, + Zo_ColorPointGY = 3922, + Zo_ColorPointGIntensity = 3935, + Zo_ColorPointBX = 3956, + Zo_ColorPointBY = 3969, + Zo_ColorPointBIntensity = 3982, + Zo_Illuminance = 4003, + Zo_IlluminanceMinMeasuredValue = 4015, + Zo_IlluminanceMaxMeasuredValue = 4043, + Zo_IlluminanceTolerance = 4071, + Zo_IlluminanceLightSensorType = 4092, + Zo_IlluminanceLevelStatus = 4119, + Zo_IlluminanceTargetLevel = 4142, + Zo_Temperature = 4165, + Zo_TemperatureMinMeasuredValue = 4177, + Zo_TemperatureMaxMeasuredValue = 4205, + Zo_TemperatureTolerance = 4233, + Zo_Pressure = 4254, + Zo_PressureMinMeasuredValue = 4263, + Zo_PressureMaxMeasuredValue = 4288, + Zo_PressureTolerance = 4313, + Zo_PressureScaledValue = 4331, + Zo_PressureMinScaledValue = 4351, + Zo_PressureMaxScaledValue = 4374, + Zo_PressureScaledTolerance = 4397, + Zo_PressureScale = 4421, + Zo_SeaPressure = 4435, + Zo_FlowRate = 4447, + Zo_FlowMinMeasuredValue = 4456, + Zo_FlowMaxMeasuredValue = 4477, + Zo_FlowTolerance = 4498, + Zo_Humidity = 4512, + Zo_HumidityMinMeasuredValue = 4521, + Zo_HumidityMaxMeasuredValue = 4546, + Zo_HumidityTolerance = 4571, + Zo_Occupancy = 4589, + Zo_OccupancySensorType = 4599, + Zo_ZoneState = 4619, + Zo_ZoneType = 4629, + Zo_ZoneStatus = 4638, + Zo_CIE = 4649, + Zo_Contact = 4653, + Zo_Fire = 4661, + Zo_Water = 4666, + Zo_CO = 4672, + Zo_PersonalAlarm = 4675, + Zo_Movement = 4689, + Zo_Panic = 4698, + Zo_GlassBreak = 4704, + Zo_EnergyTotal = 4715, + Zo_CompanyName = 4727, + Zo_MeterTypeID = 4739, + Zo_DataQualityID = 4751, + Zo_CustomerName = 4765, + Zo_Model = 4778, + Zo_PartNumber = 4784, + Zo_ProductRevision = 4795, + Zo_SoftwareRevision = 4811, + Zo_UtilityName = 4828, + Zo_POD = 4840, + Zo_AvailablePower = 4844, + Zo_PowerThreshold = 4859, + Zo_RMSVoltage = 4874, + Zo_RMSCurrent = 4885, + Zo_ActivePower = 4896, + Zo_ReactivePower = 4908, + Zo_ApparentPower = 4922, + Zo_NumberOfResets = 4936, + Zo_PersistentMemoryWrites = 4951, + Zo_LastMessageLQI = 4974, + Zo_LastMessageRSSI = 4989, + Zo_TuyaScheduleWorkdays = 5005, + Zo_TuyaScheduleHolidays = 5026, + Zo_Power2 = 5047, + Zo_Power3 = 5054, + Zo_Power4 = 5061, + Zo_TuyaChildLock = 5068, + Zo_TuyaWindowDetection = 5082, + Zo_TuyaValveDetection = 5102, + Zo_TuyaAutoLock = 5121, + Zo_TuyaTempTarget = 5134, + Zo_TuyaBattery = 5149, + Zo_TuyaMinTemp = 5161, + Zo_TuyaMaxTemp = 5173, + Zo_TuyaBoostTime = 5185, + Zo_TuyaComfortTemp = 5199, + Zo_TuyaEcoTemp = 5215, + Zo_TuyaValvePosition = 5227, + Zo_TuyaAwayTemp = 5245, + Zo_TuyaAwayDays = 5258, + Zo_TuyaPreset = 5271, + Zo_TuyaFanMode = 5282, + Zo_TuyaForceMode = 5294, + Zo_TuyaWeekSelect = 5308, + Zo_OppleMode = 5323, + Zo_TerncyDuration = 5333, + Zo_TerncyRotate = 5348, + Zo_Identify = 5361, + Zo_xxxx = 5370, + Zo_IdentifyQuery = 5375, + Zo_AddGroup = 5389, + Zo_xxxx00 = 5398, + Zo_ViewGroup = 5405, + Zo_GetGroup = 5415, + Zo_01xxxx = 5424, + Zo_GetAllGroups = 5431, + Zo_00 = 5444, + Zo_RemoveGroup = 5447, + Zo_RemoveAllGroups = 5459, + Zo_ViewScene = 5475, + Zo_xxxxyy = 5485, + Zo_RemoveScene = 5492, + Zo_RemoveAllScenes = 5504, + Zo_RecallScene = 5520, + Zo_GetSceneMembership = 5532, + Zo_PowerOffEffect = 5551, + Zo_xxyy = 5566, + Zo_PowerOnRecall = 5571, + Zo_PowerOnTimer = 5585, + Zo_xxyyyyzzzz = 5598, + Zo_xx0A00 = 5609, + Zo_DimmerUp = 5616, + Zo_00190200 = 5625, + Zo_DimmerDown = 5634, + Zo_01190200 = 5645, + Zo_DimmerStop = 5654, + Zo_ResetAlarm = 5665, + Zo_xxyyyy = 5676, + Zo_ResetAllAlarms = 5683, + Zo_xx000A00 = 5698, + Zo_HueSat = 5707, + Zo_xxyy0A00 = 5714, + Zo_Color = 5723, + Zo_xxxxyyyy0A00 = 5729, + Zo_xxxx0A00 = 5742, + Zo_ShutterOpen = 5751, + Zo_ShutterClose = 5763, + Zo_ShutterStop = 5776, + Zo_ShutterLift = 5788, + Zo_xx = 5800, + Zo_ShutterTilt = 5803, + Zo_Shutter = 5815, + Zo_DimmerMove = 5823, + Zo_xx0A = 5834, + Zo_DimmerStepUp = 5839, + Zo_00xx0A00 = 5852, + Zo_DimmerStepDown = 5861, + Zo_01xx0A00 = 5876, + Zo_DimmerStep = 5885, + Zo_xx190A00 = 5896, + Zo_01 = 5905, + Zo_HueMove = 5908, + Zo_xx19 = 5916, + Zo_HueStepUp = 5921, + Zo_HueStepDown = 5931, + Zo_03xx0A00 = 5943, + Zo_HueStep = 5952, + Zo_SatMove = 5960, + Zo_SatStep = 5968, + Zo_xx190A = 5976, + Zo_ColorMove = 5983, + Zo_xxxxyyyy = 5993, + Zo_ColorStep = 6002, + Zo_ColorTempMoveUp = 6012, + Zo_01xxxx000000000000 = 6028, + Zo_ColorTempMoveDown = 6047, + Zo_03xxxx000000000000 = 6065, + Zo_ColorTempMoveStop = 6084, + Zo_00xxxx000000000000 = 6102, + Zo_ColorTempMove = 6121, + Zo_xxyyyy000000000000 = 6135, + Zo_ColorTempStepUp = 6154, + Zo_01xxxx0A0000000000 = 6170, + Zo_ColorTempStepDown = 6189, + Zo_03xxxx0A0000000000 = 6207, + Zo_ColorTempStep = 6226, + Zo_xxyyyy0A0000000000 = 6240, + Zo_ArrowClick = 6259, + Zo_ArrowHold = 6270, + Zo_ArrowRelease = 6280, + Zo_ZoneStatusChange = 6293, + Zo_xxxxyyzz = 6310, + Zo_xxyyzzzz = 6319, + Zo_AddScene = 6328, + Zo_xxyyyyzz = 6337, + Zo_StoreScene = 6346, }; diff --git a/tasmota/xdrv_23_zigbee_5_converters.ino b/tasmota/xdrv_23_zigbee_5_converters.ino index d18ff3547..5f5b5f868 100644 --- a/tasmota/xdrv_23_zigbee_5_converters.ino +++ b/tasmota/xdrv_23_zigbee_5_converters.ino @@ -466,6 +466,13 @@ const Z_AttributeConverter Z_PostProcess[] PROGMEM = { { Zuint8, Cx0201, 0x4001, Z_(ValvePosition), Cm1, 0 }, { Zuint8, Cx0201, 0x4002, Z_(EurotronicErrors), Cm1, 0 }, { Zint16, Cx0201, 0x4003, Z_(CurrentTemperatureSetPoint), Cm_100, 0 }, + { Zuint24, Cx0201, 0x4008, Z_(EurotronicHostFlags), Cm1, 0 }, + // below are synthetic virtual attributes used to decode EurotronicHostFlags + // Last byte acts as a field mask for the lowest byte value + { Zbool, Cx0201, 0xF002, Z_(TRVMirrorDisplay), Cm1, 0 }, + { Zbool, Cx0201, 0xF004, Z_(TRVBoost), Cm1, 0 }, + { Zbool, Cx0201, 0xF010, Z_(TRVWindowOpen), Cm1, 0 }, + { Zbool, Cx0201, 0xF080, Z_(TRVChildProtection), Cm1, 0 }, // below are virtual attributes to simplify ZbData import/export { Zuint8, Cx0201, 0xFFF0, Z_(ThSetpoint), Cm1 + Z_EXPORT_DATA, Z_MAPPING(Z_Data_Thermo, th_setpoint) }, { Zint16, Cx0201, 0xFFF1, Z_(TempTarget), Cm_100 + Z_EXPORT_DATA, Z_MAPPING(Z_Data_Thermo, temperature_target) }, @@ -879,6 +886,11 @@ int32_t encodeSingleAttribute(class SBuffer &buf, double val_d, const char *val_ buf.add16(u32); break; // unisgned 32 + case Zuint24: + buf.add16(u32); + buf.add8(u32 >> 16); + break; + // unisgned 24 case Zuint32: // uint32 case Zdata32: // data32 case Zmap32: // map32 @@ -974,6 +986,15 @@ uint32_t parseSingleAttribute(Z_attribute & attr, const SBuffer &buf, } } break; + case Zuint24: + { + uint32_t uint24_val = buf.get16(i) + (buf.get8(i+2) >> 16); + // i += 3; + if (0xFFFFFF != uint24_val) { + attr.setUInt(uint24_val); + } + } + break; case Zuint32: // uint32 case ZUTC: // UTC { @@ -1280,15 +1301,24 @@ void ZCLFrame::computeSyntheticAttributes(Z_attribute_list& attr_list) { } break; case 0x02010008: // Pi Heating Demand - solve Eutotronic bug + case 0x02014008: // Eurotronic Host Flags decoding { const char * manufacturer_c = zigbee_devices.getManufacturerId(_srcaddr); // null if unknown String manufacturerId((char*) manufacturer_c); if (manufacturerId.equals(F("Eurotronic"))) { - // Eurotronic does not report 0..100 but 0..255, including 255 which is normally an ivalid value - uint8_t valve = attr.getUInt(); - if (attr.isNone()) { valve = 255; } - uint8_t valve_100 = changeUIntScale(valve, 0, 255, 0, 100); - attr.setUInt(valve_100); + if (ccccaaaa == 0x02010008) { + // Eurotronic does not report 0..100 but 0..255, including 255 which is normally an ivalid value + uint8_t valve = attr.getUInt(); + if (attr.isNone()) { valve = 255; } + uint8_t valve_100 = changeUIntScale(valve, 0, 255, 0, 100); + attr.setUInt(valve_100); + } else if (ccccaaaa == 0x02014008) { + uint32_t mode = attr.getUInt(); + if (mode & 0x02) { attr_list.addAttribute(0x0201, 0xF002).setUInt(1); } + if (mode & 0x04) { attr_list.addAttribute(0x0201, 0xF004).setUInt(1); } + if (mode & 0x10) { attr_list.addAttribute(0x0201, 0xF010).setUInt(1); } + if (mode & 0x80) { attr_list.addAttribute(0x0201, 0xF080).setUInt(1); } + } } } break; diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 9b8df0762..63c44b3c1 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -160,7 +160,7 @@ int32_t ShutterPercentToRealPosition(uint32_t percent, uint32_t index) if (Settings.shutter_set50percent[index] != 50) { return (percent <= 5) ? Settings.shuttercoeff[2][index] * percent*10 : (Settings.shuttercoeff[1][index] * percent + (Settings.shuttercoeff[0][index]*10))*10; } else { - uint32_t realpos; + int64_t realpos; // check against DIV 0 for (uint32_t j = 0; j < 5; j++) { if (0 == Settings.shuttercoeff[j][index]) { @@ -173,13 +173,15 @@ int32_t ShutterPercentToRealPosition(uint32_t percent, uint32_t index) for (uint32_t k = 0; k < 5; k++) { if ((percent * 10) >= Settings.shuttercoeff[k][index]) { realpos = SHT_DIV_ROUND(Shutter[index].open_max * calibrate_pos[k+1], 100); - //AddLog_P(LOG_LEVEL_DEBUG, PSTR("Realposition TEMP1: %d, %% %d, coeff %d"), realpos, percent, Settings.shuttercoeff[i][index]); + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Realposition TEMP1: %d, %d %%, coeff %d"), realpos, percent, Settings.shuttercoeff[k][index]); } else { + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Shutter[%d].open_max: %d"),index, Shutter[index].open_max); if (0 == k) { - realpos = SHT_DIV_ROUND(SHT_DIV_ROUND(percent * Shutter[index].open_max * calibrate_pos[k+1], Settings.shuttercoeff[k][index]), 10); + realpos = SHT_DIV_ROUND(SHT_DIV_ROUND(percent * Shutter[index].open_max * calibrate_pos[k+1], Settings.shuttercoeff[k][index]), 10 ); + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Realposition TEMP3: %d, %d %%, coeff %d"), realpos, percent, Settings.shuttercoeff[k][index]); } else { - //uint16_t addon = ( percent*10 - Settings.shuttercoeff[i-1][index] ) * Shutter_Open_Max[index] * (calibrate_pos[i+1] - calibrate_pos[i]) / (Settings.shuttercoeff[i][index] -Settings.shuttercoeff[i-1][index]) / 100; - //AddLog_P(LOG_LEVEL_DEBUG, PSTR("Realposition TEMP2: %d, %% %d, coeff %d"), addon, (calibrate_pos[i+1] - calibrate_pos[i]), (Settings.shuttercoeff[i][index] -Settings.shuttercoeff[i-1][index])); + //uint32_t addon = ( percent*10 - Settings.shuttercoeff[k-1][index] ) * Shutter[index].open_max * (calibrate_pos[k+1] - calibrate_pos[k]) / (Settings.shuttercoeff[k][index] -Settings.shuttercoeff[k-1][index]) / 100; + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Realposition TEMP2: %d, %d %%, coeff %d"), addon, (calibrate_pos[k+1] - calibrate_pos[k]), (Settings.shuttercoeff[k][index] -Settings.shuttercoeff[k-1][index])); realpos += SHT_DIV_ROUND(SHT_DIV_ROUND((percent*10 - Settings.shuttercoeff[k-1][index] ) * Shutter[index].open_max * (calibrate_pos[k+1] - calibrate_pos[k]), Settings.shuttercoeff[k][index] - Settings.shuttercoeff[k-1][index]), 100); } break; @@ -189,25 +191,26 @@ int32_t ShutterPercentToRealPosition(uint32_t percent, uint32_t index) } } -uint8_t ShutterRealToPercentPosition(int32_t realpos, uint32_t index) +uint8_t ShutterRealToPercentPosition(int64_t realpos, uint32_t index) { if (Settings.shutter_set50percent[index] != 50) { return (Settings.shuttercoeff[2][index] * 5 > realpos/10) ? SHT_DIV_ROUND(realpos/10, Settings.shuttercoeff[2][index]) : SHT_DIV_ROUND(realpos/10-Settings.shuttercoeff[0][index]*10, Settings.shuttercoeff[1][index]); } else { - uint16_t realpercent; - + uint64_t realpercent; for (uint32_t j = 0; j < 5; j++) { if (realpos >= Shutter[index].open_max * calibrate_pos[j+1] / 100) { realpercent = SHT_DIV_ROUND(Settings.shuttercoeff[j][index], 10); - //AddLog_P(LOG_LEVEL_DEBUG, PSTR("Realpercent TEMP1: %d, %% %d, coeff %d"), realpercent, realpos, Shutter_Open_Max[index] * calibrate_pos[i+1] / 100); + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Realpercent TEMP1: %d %%, %d, coeff %d"), realpercent, realpos, Shutter[index].open_max * calibrate_pos[j+1] / 100); } else { + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Shutter[%d].open_max: %d"),index, Shutter[index].open_max); if (0 == j) { - realpercent = SHT_DIV_ROUND(SHT_DIV_ROUND((realpos - SHT_DIV_ROUND(Shutter[index].open_max * calibrate_pos[j], 100)) * 10 * Settings.shuttercoeff[j][index], calibrate_pos[j+1]), Shutter[index].open_max); + realpercent = SHT_DIV_ROUND(SHT_DIV_ROUND((realpos - SHT_DIV_ROUND(Shutter[index].open_max * calibrate_pos[j], 100)) * Settings.shuttercoeff[j][index], calibrate_pos[j+1]/10), Shutter[index].open_max); + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Realpercent TEMP3: %d %%, %d, coeff %d"), realpercent, realpos, Shutter[index].open_max * calibrate_pos[j+1] / 100); } else { - //uint16_t addon = ( realpos - (Shutter_Open_Max[index] * calibrate_pos[i] / 100) ) * 10 * (Settings.shuttercoeff[i][index] - Settings.shuttercoeff[i-1][index]) / (calibrate_pos[i+1] - calibrate_pos[i])/ Shutter_Open_Max[index]; - //uint16_t addon = ( percent*10 - Settings.shuttercoeff[i-1][index] ) * Shutter_Open_Max[index] * (calibrate_pos[i+1] - calibrate_pos[i]) / (Settings.shuttercoeff[i][index] -Settings.shuttercoeff[i-1][index]) / 100; - //AddLog_P(LOG_LEVEL_DEBUG, PSTR("Realpercent TEMP2: %d, delta %d, %% %d, coeff %d"), addon,( realpos - (Shutter_Open_Max[index] * calibrate_pos[i] / 100) ) , (calibrate_pos[i+1] - calibrate_pos[i])* Shutter_Open_Max[index]/100, (Settings.shuttercoeff[i][index] -Settings.shuttercoeff[i-1][index])); - realpercent += SHT_DIV_ROUND(SHT_DIV_ROUND((realpos - SHT_DIV_ROUND(Shutter[index].open_max * calibrate_pos[j], 100)) * 10 * (Settings.shuttercoeff[j][index] - Settings.shuttercoeff[j-1][index]), (calibrate_pos[j+1] - calibrate_pos[j])), Shutter[index].open_max) ; + //uint16_t addon = ( realpos - (Shutter[index].open_max * calibrate_pos[j] / 100) ) * 10 * (Settings.shuttercoeff[j][index] - Settings.shuttercoeff[j-1][index]) / (calibrate_pos[j+1] - calibrate_pos[j])/Shutter[index].open_max; + //uint16_t addon = ( realpercent*10 - Settings.shuttercoeff[j-1][index] ) * Shutter[index].open_max * (calibrate_pos[j+1] - calibrate_pos[j]) / (Settings.shuttercoeff[j][index] -Settings.shuttercoeff[j-1][index]) / 100; + //AddLog_P(LOG_LEVEL_ERROR, PSTR("Realpercent TEMP2: %d %%, delta %d, %d, coeff %d"), addon,( realpos - (Shutter[index].open_max * calibrate_pos[j] / 100) ) , (calibrate_pos[j+1] - calibrate_pos[j])* Shutter[index].open_max/100, (Settings.shuttercoeff[j][index] -Settings.shuttercoeff[j-1][index])); + realpercent += SHT_DIV_ROUND(SHT_DIV_ROUND((realpos - SHT_DIV_ROUND(Shutter[index].open_max * calibrate_pos[j], 100)) * (Settings.shuttercoeff[j][index] - Settings.shuttercoeff[j-1][index]), (calibrate_pos[j+1] - calibrate_pos[j])/10), Shutter[index].open_max) ; } break; } diff --git a/tasmota/xlgt_04_sm2135.ino b/tasmota/xlgt_04_sm2135.ino index dd766ab33..92d1d5059 100644 --- a/tasmota/xlgt_04_sm2135.ino +++ b/tasmota/xlgt_04_sm2135.ino @@ -182,21 +182,12 @@ void Sm2135ModuleSelected(void) Sm2135.clk = Pin(GPIO_SM2135_CLK); Sm2135.data = Pin(GPIO_SM2135_DAT, GPIO_ANY); - Sm2135.model = SM2135_WCGRB; + Sm2135.model = GetPin(Sm2135.data) - AGPIO(GPIO_SM2135_DAT); // 0 .. 3 if (PinUsed(GPIO_SWT1)) { Sm2135.model = SM2135_WCBGR; pinMode(Pin(GPIO_SWT1), INPUT); // Discard GPIO_SWT functionality SetPin(Pin(GPIO_SWT1), AGPIO(GPIO_NONE)); } - if (PinUsed(GPIO_SM2135_DAT, 1)) { - Sm2135.model = SM2135_WCBGR; - } - if (PinUsed(GPIO_SM2135_DAT, 2)) { - Sm2135.model = SM2135_WCGRBHI; - } - if (PinUsed(GPIO_SM2135_DAT, 3)) { - Sm2135.model = SM2135_WCBGRHI; - } // RGB current CW current Sm2135.current = (SM2135_20MA << 4) | SM2135_15MA; // See https://github.com/arendst/Tasmota/issues/6495#issuecomment-549121683 diff --git a/tasmota/xsns_02_analog.ino b/tasmota/xsns_02_analog.ino index 287f1a7b9..a4a23de97 100644 --- a/tasmota/xsns_02_analog.ino +++ b/tasmota/xsns_02_analog.ino @@ -27,12 +27,15 @@ #ifdef ESP8266 #define ANALOG_RESOLUTION 10 // 12 = 4095, 11 = 2047, 10 = 1023 #define ANALOG_RANGE 1023 // 4095 = 12, 2047 = 11, 1023 = 10 +#define ANALOG_PERCENT 10 // backward compatible div10 range #endif // ESP8266 #ifdef ESP32 #undef ANALOG_RESOLUTION #define ANALOG_RESOLUTION 12 // 12 = 4095, 11 = 2047, 10 = 1023 #undef ANALOG_RANGE #define ANALOG_RANGE 4095 // 4095 = 12, 2047 = 11, 1023 = 10 +#undef ANALOG_PERCENT +#define ANALOG_PERCENT ((ANALOG_RANGE + 50) / 100) // approximation to 1% ADC range #endif // ESP32 #define TO_CELSIUS(x) ((x) - 273.15) @@ -259,9 +262,9 @@ void AdcEvery250ms(void) { #endif if (ADC_INPUT == Adc[idx].type) { uint16_t new_value = AdcRead(Adc[idx].pin, 5); - if ((new_value < Adc[idx].last_value -10) || (new_value > Adc[idx].last_value +10)) { + if ((new_value < Adc[idx].last_value -ANALOG_PERCENT) || (new_value > Adc[idx].last_value +ANALOG_PERCENT)) { Adc[idx].last_value = new_value; - uint16_t value = Adc[idx].last_value / 10; + uint16_t value = Adc[idx].last_value / ANALOG_PERCENT; Response_P(PSTR("{\"ANALOG\":{\"A%ddiv10\":%d}}"), idx + offset, (value > 99) ? 100 : value); XdrvRulesProcess(); }