ESPHome BLE access to Tuya

Following this excellent repo: GitHub - BillyNate/esphome-tuya-ble: An ESPhome component for controlling BLE (Bluetooth) enabled devices from Tuya · GitHub, I cloned it and with some Claude help extended it to support a Restmo O-WM-2-BT water flow meter. Working implementation is here: GitHub - pcr20/esphome-tuya-ble: An ESPhome component for controlling BLE (Bluetooth) enabled devices from Tuya · GitHub

My usage pattern is that I use a ESP32 essentially as a BLE to Wifi bridge (I have mesh wifi covering a wide range, including the garden, and I want to have a flow meter integrated with Homeassistant). Therefore this project uses an ESP32 with ESPHome to connect to a Tuya device - effectively mimicking the SmartLife app (but without any Tuya cloud connectivity).

Prerequisites are that you need the local_key, UUID, ID of the Tuya device. This implementation is very limited, but it updates and extends BillyNate's old light implementation to sensors.