ThomDietrich / miflora-mqtt-daemon

Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼πŸ₯€πŸ‘🌳
MIT License
610 stars 140 forks source link

Home Assistant MQTT Sensor discovery enhancements, areas support. #102

Closed bangom closed 4 years ago

bangom commented 4 years ago

According to HA MQTT Sensor Discovery (https://www.home-assistant.io/integrations/sensor.mqtt/) miflora-mqtt-daemon should also send sensor's "unique_id" along with it's "parent device" information (identifiers, connections, firmware, ... ) configuration variables. After that, the discovered MQTT sensor is added automatically into HA Device Registry (https://developers.home-assistant.io/docs/device_registry_index/) and visible in HA GUI. Also, Miflora sensor can be then used with HA Areas.

Whole enhancement is discussed in #101 .

ThomDietrich commented 4 years ago

In the Home Assistant device view the battery level for smartphones is given. Seems like that is not supported by MQTT Sensor. Do you know more about that?

bangom commented 4 years ago

In the Home Assistant device view the battery level for smartphones is given. Seems like that is not supported by MQTT Sensor. Do you know more about that?

Can you clarify what you mean? Battery levels on my screenshot ( #101 ) are Miflora battery levels... or do you mean something else?

ThomDietrich commented 4 years ago

...on my screenshot...

Aha! Didn't see them. That is pretty cool! I expected that a device would need to specifically state that/where/how battery state data is provided.

All good. I will test and merge this evening

ThomDietrich commented 4 years ago

@bangom I tried your PR and with that the HA integration. I have Bluetooth connection issues on my RPI0W and will need to look into this. Anyhow, I added some cosmetic improvements to your PR. If you have the chance to double check, that would be amazing. I'll merge after.

ThomDietrich commented 4 years ago

I have Bluetooth connection issues

Turns out that my two years old sensors with firmware version 2.6.2 are not supported by btlewrap πŸ€·β€β™‚ Just in case you are interested

bangom commented 4 years ago

@bangom I tried your PR and with that the HA integration. I have Bluetooth connection issues on my RPI0W and will need to look into this. Anyhow, I added some cosmetic improvements to your PR. If you have the chance to double check, that would be amazing. I'll merge after.

Seems OK to me, tested latest git version with merged pull.