NRF52840 sense and bluetooth: tuya sensor refuses to show up?!

It appears to me Tuya is not following the bluetooth standards on this one. The advertised data frame is decoded incorrectly, resulting in the flags set to 1, whereas the code expects either 0x03 or 0x04 to be set. For now I solved this by changing the flag mask from 0x18 to 0x19.

I am pondering to just make new firmware for the sensor. As stated, it uses a PHY6222, which is a BLE SOC. So it should work. I feel like they added some tuya specific ‘security’ to force you to stay in the tuya ecosystem, which clearly I’m not.

http://www.k-sol.com.hk/assets/phy6222_ble_soc_datasheet_v1.0-20201204.pdf