Arduino MEGA, ESP32, ESP8266
BLE compact window/door sensor with open-close status.
Note that the sensor advertises regularly its status and send also a message when opening and closing (action).
These 2 types of messages are converted to publish open:true or open:false to MQTT
If your use case requires you to see the open status promptly after the event, you have to consider changing the BLE interval to 1 and the scan duration to 1000 so as to get better performances.