plantgateway icon indicating copy to clipboard operation
plantgateway copied to clipboard

Add device to Home Assistant auto-discovery

Open PeteBa opened this issue 5 years ago • 1 comments

This PR adds a unique_id to the discovery payload so that sensors are persisted in the Entity Registry. In addition, this adds Device information so that you can see all of the entities associated with each physical MiFlora device.

@ChristianKuehnel , I have assumed that the only devices recognised are Xiaomi (Line 304). Is that correct or does the gateway also detect other manufacturers ? Also, I see in the library that MiFloraPoller.name() does not retrieve from cache but makes an additional bluetooth connection. Would it be worth caching name in the same way that firmware_version is cached ?

PeteBa avatar Sep 21 '19 13:09 PeteBa

@PeteBa To respond to your question regarding other manufacturers: I'm pretty sure a lot of the other brands on Amazon at least (for example, OLLIVAN) use the exact same internals as the Xiaomi products. I was able to connect my OLLIVAN sensors without any difficulty.

eribbey avatar Apr 13 '21 19:04 eribbey