Homey Community Forum

Xiaomi mi flora sensor/ropot app

If I’m right, a new capability is added in device.onInit( ) with addCapability(). That doesn’t remove the old one. This will stay until the device is deleted. New added devices only have the new capability.
So it seems you have re-added the device and @Peter_Kawa kept the device.

You could remove old capabilities with removeCapability( ) in onInit( ) to clear the devices. If the new app cersion starts, all old capabilities would be removed for all users.

Edit: Ceck with hasCapability( ) before add/remove to avoid exceptions. But you surely have the check already in your code for adding the new capability.

1 Like

I think not, while the new capabilities became available for my device tiles after v4.0.0-test install.

.

True, I only installed the updated app and didn’t touch the devices

I’ve checked the code. First the new capabilities are added, and then the old removed if they exist.

This part is only executed once.

Are you sure the old devices capabilities are gone from the device?

Yes, these are the current and available capabilities
The values represent the recent values of Insights graph “Aug. until Oct.”.

So only Insights kept the old capabilities as far as I can see.

Developer:

Cheers & thanks

Hi Koktail

I have around 30 Plant Sensors, most of them I can reach via Homey BLWE directly
But there are some I can’t reach and have to mange the plants otherwise

What do you think of an enhancement of your app for range extension via MqTT, so that plant data which is not reachable direct via BLE can be integrated via MQTT.

Exentension could be done with: GitHub - 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 🌱🌼🥀🏡🌳 and a simple raspberry
You can get the data from an MQTT Broker (this could be Homey) and the script above is sending the flora plant data to it. Would be great if this data can be integrated in your app, too .

I am willing to support that extension with a donation :wink: maybe others, too.
What do you think ?

Also nice for experimenting with Ble 2 mqtt!
Thanks.

Alternative:
Will an ESP32 with this software do?

Hello,

I already did it…using an ESP32 and some code from GitHub.
Set yout BT-Macs of your plant sensors and the IP/user/pw of your MQTT broker and the ESP will read your sensors and push the data to your broker.
Then you can import it with Mqtt client or hub. Not into your current devices, but into virtual sensors or hub devices

Sorry, only german. Just ask if you need some help.

1 Like

If someone needs the modified code for the ESP32…just download here:

2 Likes

Unfortunatly it’s not working anymore since Homey v7.5.1 , is there something i can do to fix the values getting updated ?

-Edit : Had to re-install the app and connect all sensors again. after this it worked again