hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
267 stars 52 forks source link

Add flower-care fonction definitively #44

Closed robotsflo closed 2 years ago

robotsflo commented 5 years ago

Hi,

Your work is awesome, the mijia hygrothermograph scanning is very reactive. I try to use "https://github.com/honkmaster/homebridge-mi-flower-care" as the same time, but it doesn't work properly : (result of debug) [2019-3-14 18:50:45] [Sonde Mijia 1] Stopped scanning. [2019-3-14 18:50:45] [Sonde Mijia 2] Stopped scanning. [2019-3-14 18:50:45] [Sonde Mijia 3] Stopped scanning. [2019-3-14 18:50:45] [Sonde Mijia 4] Stopped scanning. [2019-3-14 18:50:47] [Sonde Mijia 1] Start scanning. [2019-3-14 18:50:47] [Sonde Mijia 2] Start scanning. [2019-3-14 18:50:47] [Sonde Mijia 3] Start scanning. [2019-3-14 18:50:47] [Sonde Mijia 4] Start scanning.

Would you add the flower care fonctionnality to your plugin ? For saving battery life, i think it's important to add a scan interval to the flower sensors. (if you can add a possibility to change dynamicly this interval with a mqtt request eg : miflower/intervalscan -> 300 for 5 minutes )

Thanks a lot for your reply.

hannseman commented 5 years ago

Hi. Yes there’s interference when using this plugin with other plugins which also initiates a scan for Bluetooth devices.

The starting and stopping you see is functionality implemented to restart scanning when stopped by a third-party.

Are you saying that when adding the flower-plugin you don’t get any new values in this plugin?

The battery is not an issue with using this plugin as the value reading is totally passive by reading the Bluetooth advertisement packages the sensor sends out once per second.

I have actually implemented parsing the flower sensor data from the advertisement packages but have yet to expose them to homebridge. I’ll have to figure out how to implement this in a good way.

robotsflo commented 5 years ago

Ok, This is a very good job, I look forward to seeing the results !

Ps : I have found this, if you need : https://github.com/ChrisScheffler/miflora/wiki/The-Basics

robotsflo commented 5 years ago

Hi. You say as you can collect flower data passively. Can you implement mqtt publishing in first time. I just supposed that is simple because this fonction is already present for mijia. Thanks for your reply.

DSchumacher2104 commented 5 years ago

Perhaps it is possilbe to copy the functions from 'homebridge-mi-flower-care' into your plugin? I think this plugin works very similar to yours.

hannseman commented 5 years ago

@DSchumacher2104 not really as the homebridge-mi-flower-care plugin connects to the device and reads the data through BLE characteristics. This plugin reads the data through BLE advertisement packets.

But as I wrote earlier in this issue I have a proof of concept for reading these packages for the flower devices. I've implementing this by reading logs posted online but I do not have this device in my possession. Until I actually have a flower device I do not feel comfortable with releasing anything. But if you want to try it out please open a PR. The events to listen to can be found here https://github.com/hannseman/homebridge-mi-hygrothermograph/blob/master/lib/scanner.js#L75.

robotsflo commented 5 years ago

Hi @hannseman,

Do you have bought an mi flower care to test your implentation for this device ?

Best regards

DSchumacher2104 commented 5 years ago

@hannseman I'm very interested! How can i try this out? By simply adding the MAC-Address of my Flower Care Sensor in config.json?

hannseman commented 5 years ago

@DSchumacher2104 I haven't implemented the homebridge characteristics for these values yet but you can check if it works as expected by running a small node-script like this:

const { Scanner } = require("homebridge-mi-hygrothermograph/lib/scanner");
const macAddress = "DEADBEEFDEADBEEF";
const scanner = new Scanner(macAddress);
scanner.on("temperatureChange", function (value, peripheral) {
    console.log("Temperature", value);
});
scanner.on("humidityChange", function (value, peripheral) {
    console.log("Humidity", value);
});
scanner.on("illuminanceChange", function (value, peripheral) {
    console.log("Illuminance", value);
});
scanner.on("moistureChange", function (value, peripheral) {
    console.log("Moisture", value);
});
scanner.on("fertilityChange", function (value, peripheral) {
    console.log("Fertility", value);
});

Let me know if it works as I've never tested this with an actual sensor.

DJay-X commented 5 years ago

Hi Guys. Any news on the Xiaomi Flower Care Sensors and the plugin? I just added the MAC from my two new sensors and Temp is showing up. Unfortunately no moist and battery level. Just because of my only two existing Flower Care sensors I don't want to crash my homebridge with another plugin or this. So any chance the sensor can be fully integrated in this plugin as well? Thanks again @hannseman Napkin 2 12 08 19, 1 41 21 PM

ghost commented 5 years ago

Hi Guys. Any news on the Xiaomi Flower Care Sensors and the plugin? I just added the MAC from my two new sensors and Temp is showing up. Unfortunately no moist and battery level. Just because of my only two existing Flower Care sensors I don't want to crash my homebridge with another plugin or this. So any chance the sensor can be fully integrated in this plugin as well? Thanks again @hannseman Napkin 2 12 08 19, 1 41 21 PM

Hi @hannseman I habe the exact same behaviour like @DJay-X

I am using the mi-flower-care Plugin on my Pi4 and this Plugin for test purposes on my PI3B+.

On my Pi4 I am seeing Temperature, Lux, Humidity and Battery Level. On your Plugin I am only seeing Temperature.

Is there anything I can provide you for troubleshooting like additional logs etc?

hannseman commented 5 years ago

@misanthrophy it is simply not supported since I have not written the code to support the flower devices. It's next on my todo-list for this project so subscribe to this issue for updates.

ghost commented 5 years ago

Awesome @hannseman ! If there is anything I can provide you with for debugging etc. Just let me know!

d4ni37 commented 4 years ago

Definitely keen for this also, happy to support with debugging... Miss this ever since having to upgrade past Node 9.

souimanga commented 4 years ago

Hi, great job ! Do you have any news for your implementation ? If you need any help for logs or something! Bye

NathanAMiller commented 4 years ago

Hello @hannseman Thanks for your great plugin. Any update on supporting mi-flower-care devices?

netRunner0 commented 4 years ago

Up Up Up

souimanga commented 4 years ago

Up up up too 😬

alexbell62 commented 3 years ago

hi @hannseman thanks for pointing me to the correct issue thread. This issue seems to be 1.5y old. Do you think it's super unlikely it's going to be fixed?

codyc1515 commented 3 years ago

The Temperature is working for me on Flower Care, but not the Humidity. This causes the whole accessory to show as “Not responding”. Strangely it’s working in the official app, so must be an issue with the plug-in. Any thoughts before I start investigating this?

souimanga commented 3 years ago

@codyc1515 Could I help you ?

d4ni37 commented 3 years ago

@codyc1515 have you started investigating this? Loved your Bhyve homebridge plug-in by the way!

Aekung commented 3 years ago

I still hope that the mi flower care could finally be implemented and added to this plugin.

Anyone is still on this?

d4ni37 commented 3 years ago

Still very keen for this too.

hannseman commented 2 years ago

Version 3.3.0 was just released to npm with support for the Mi Flora device. Thanks @Kylmakalle for the homebridge implementation.