From 628c00f0906bd55b38820a323c1808eba9433335 Mon Sep 17 00:00:00 2001 From: Lenbok Date: Fri, 29 Oct 2021 19:43:10 +1300 Subject: [PATCH] Reflect PVVX firmware reed switch status The first bit of the flag field reflects reed switch status so this device can additionally be used to monitor the status of a door. --- tasmota/xsns_62_esp32_mi_ble.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasmota/xsns_62_esp32_mi_ble.ino b/tasmota/xsns_62_esp32_mi_ble.ino index cb9548e6e..761d1c0de 100644 --- a/tasmota/xsns_62_esp32_mi_ble.ino +++ b/tasmota/xsns_62_esp32_mi_ble.ino @@ -1586,6 +1586,10 @@ void MI32ParseATCPacket(const uint8_t * _buf, uint32_t length, const uint8_t *ad MIBLEsensors[_slot].bat = ppv_packet->battery_level; MIBLEsensors[_slot].eventType.bat = 1; + MIBLEsensors[_slot].Btn = (ppv_packet->flags) & 0x1; // First bit is reed switch status + MIBLEsensors[_slot].eventType.Btn = 1; + MIBLEsensors[_slot].feature.Btn = 1; + if(MI32.option.directBridgeMode) { MIBLEsensors[_slot].shallSendMQTT = 1; MI32.mode.shallTriggerTele = 1; @@ -3271,4 +3275,4 @@ bool Xsns62(uint8_t function) #endif // CONFIG_IDF_TARGET_ESP32 or CONFIG_IDF_TARGET_ESP32C3 #endif // ESP32 -#endif \ No newline at end of file +#endif