Thanks for your reply.
I tried another sensor to experiment with the various protocols.
HA picked it up as a Xiaomi BLE even with the custom firmware,
but only found one entity inside (power level).
With the previous devices I did try the guide’s advice of using
BTHome or pvvx protocols but had trouble maintaining connection.
After quite a lot of reading I opted for the device’s native protocol (MIJA) for those.
My point is that HA’s Xiaomi BLE integration does seem to support that well.
With this third device I started the pvvx protocol.
Left the Advertising Interval and Measurement Interval at their defaults
(2500ms, 4x) to make sure there was plenty of communication going on.
I did not enable the BT5+PHY or LE Long Range options.
The device showed up from time to time in the output of
bluetoothctl devices
run in the HA Terminal, but it showed only one entity (power level) in the HA devices page.
But I could not get HA to see any data from the device.
Tried the power cycle trick, did not help.
Next I tried BThome protocol. That worked well; the BThome integration
noticed the device after less than a minute and configured it properly.
Clicking through to the device via the Xiaomi BLE integration’s sub-panel
showed up the same information as going via the BThome sub-panel.
I still had trouble maintaining connection when changing the Advertising
Interval - I tried 5000ms (left the Measurement Interval setting at 4x)
and it worked initially but failed after a couple of hours.
I went back to the default of 1500ms and the connection was solid.
Finally I tried the MIJA protocol. I disabled the BTHome device,
changed protocols on the device and waited for HA to notice it,
which it did after a minute or two. It has stayed solidly connected
for half a day now so I might stick with that. It does not display all
the data entities that BThome does, but I only need temp & humidity.
To sum up I have working devices and can proceed with the projects
I want to use them for; I’m most grateful for your guide and
all the useful contributions people have made to it.