Thanks for putting this together! I obtained an H5075 and gave your component a try. After a couple tweaks for my setup, it’s successfully collecting data.
I’ve noticed one larger issue though – at least on my system, the averaging over a period functionality doesn’t seem to work. HASS gets an update for what appears to be every H5075 message, resulting in 3-20 state changes per minute. As such, I’ve accumulated 27,244 state changes for temperature over the last 48 hours (~10/min) and the same number for humidity. As you can imagine this has side effects like slowing down graph generation.
I’m not too well versed in python, so I may be missing something, but looking at
discovery_ble_devices, I’m not seeing anything that would suppress the call to
async_schedule_update_ha_state() from occurring on every message. It seems like the only qualification is that a temp/hum reading within bounds be present, which certainly seems to be the behavior I’m seeing.
In case it’s relevant, though I don’t think so, my setup is slightly modified in that my HASS host doesn’t have bluetooth locally, so I modified it to ssh to another host with the bluetooth interface and run hcitool/hcidump there. By default the component closes and reopens the interfaces on every cycle of discover_ble_devices, which was causing the BT hci interface to get hung up on the remote host (probably due to some issue with the way the connection/processes get shutdown), so I commented out scanner.stop and scanner.start. The SSH connections are now persistent and have been working fine (other than excess state changes, as mentioned above).
I might add a check to see if the connections are still open, and then do a slow restart, if not, so it can recover in the event the ssh connections go down.