GithubHelp home page GithubHelp logo

homey-mi-flora's Introduction

Xiaomi mi flora sensor

app image

Introduction

This app integrates the Xiaomi mi flora sensor and Xiaomi mi flora ropot into Homey.

Do you like the app? You can make me happy by buying me a beer!

Q&A

Q1 Why can’t the sensor be found by Homey?

  • Check if the sensor is connected to another bluetooth device. The Xiaomi Mi Flora app for example

Q1 Why are the readings from the sensors different from in the Xiaomi Mi Flora app?

  • It is caused by old firmware (2.7.0), try to update the sensors through the Xiaomi Mi Flora app

Q3 Is the app compatibel with v2.0.0?

  • The app is only compatible from v2.1.2 and up due to change to the BLE core.

Q4 Is the app compatibel with SDK 3?

  • Yes the app is compatible from v3.0.0

Usage

  1. Install app
  2. Add the device(s) to Homey.
  3. Configure the threshold in the device configuration.
  4. Make a flow with one of the cards.

You can configure the timeout between polls in the app's settings.

Cards

Device cards

Trigger cards

  1. Some device sensor has changed.
    • sensor (Moisture)
    • value (20%)
    • report (The moisture of Flora 1 has changed to: 20%.)
  2. Some device sensor is updated.
    • sensor (Moisture)
    • value (20%)
    • report (The moisture is updated to: 20%.)
  3. Sensor value is below the configured threshold.
    • sensor (Moisture)
    • value (20%)
    • report (The moisture (20%) is too low. This can be at least 30%.)
  4. Sensor value is above the configured threshold.
    • sensor (Moisture)
    • value (20%)
    • report (The moisture (20%) is too high. This must be a maximum of 15%.)

Condition cards

  1. De plant has a correct temperature.
  2. De plant has enough sunlight.
  3. De plant has enough nutrition.
  4. De plant has enough moisture.

Global cards

Trigger cards

  1. Some device sensor has changed.
    • device (Flora 1)
    • sensor (Moisture)
    • value (20%)
    • report (The moisture has changed to: 20%.)
  2. Some device sensor is updated.
    • device (Flora 1)
    • sensor (Moisture)
    • value (20%)
    • report (The moisture is updated to: 20%.)
  3. Sensor value is below the configured threshold.
    • device (Flora 1)
    • sensor (Moisture)
    • value (20%)
    • report (The moisture (20%) is too low. This can be at least 30%.)
  4. Sensor value is above the configured threshold.
    • device (Flora 1)
    • sensor (Moisture)
    • value (20%)
    • report (The moisture (20%) is too high. This must be a maximum of 15%.)
  5. Sensor value is outside the configured threshold.
    • device (Flora 1)
    • sensor (Moisture)
    • value (20%)
    • report (The moisture (20%) is too high. This must be a maximum of 15%.)
  6. Sensor gives a timeout after 3 tries.
    • device (Flora 1)
    • reason (Not in range)

Condition cards

  1. De plant has a correct temperature.
  2. De plant has enough sunlight.
  3. De plant has enough nutrition.
  4. De plant has enough moisture.

Action cards

  1. Synchronise all sensor values with Homey.

History

v1.0.0 - 09.04.2018

  • first alpha to app store.

v1.0.1 - 10.04.2018

  • add documentation
  • revert changes because it breaks the flow card.

v1.0.2 - 17.04.2018

  • moved capabilities to drivers because of RoPot missing one.
  • update capability name from fertilizer to nutritions.
  • change tags for capability in card to user preferred language.
  • add tags: report with a human readable report of the status.

v1.0.3 - 17.04.2018

  • add missing battery report translation

v1.0.4 - 18.04.2018

  • add missing icon
  • add documentation to readme

v1.0.5 - 20.04.2018

  • bump 1.0.4

v1.0.6 - 23.04.2018

  • bump 1.0.5

v1.0.7 - 27.04.2018

  • change trigger min/max with correct translation
  • fixed validation error
  • remove unused try catch
  • add trigger: 'outside threshold'
  • add documentation
  • bubble up error and throw exception, but before that add new timeout

v2.0.0 - 17.05.2018

  • make drivers compatible with com.mi.flora
  • refactoring capabilities
  • add settings explanation for threshold
  • add min/max validation for threshold

v2.0.1 - 18.05.2018

  • change app id

v2.0.2 - 18.05.2018

  • mark device as broken due to missing capability battery

v2.0.3 - 25.05.2018

  • add support for ropot condition cards

v2.0.4 - 25.05.2018

  • add information on the pairing screen

v2.0.5 - 25.05.2018

  • removed test code

v2.0.6 - 25.05.2018

  • resolved merge conflicts

v2.0.7 - 17.08.2018

  • resolved issue: #34 (Too many settings available for RoPot)

v2.0.8 - 17.08.2018

  • resolved issue: #41 (App crash due to missing condition card arguments)

v2.0.9 - 01.10.2018

  • resolved issue: #45 (Add a trigger card: Device is out of range)
  • add homeyCommunityTopicId for linking to new community forum
  • add html report for sending status report as email
  • improve error handling and prevent un-disconnected devices

v2.0.10 - 01.10.2018

  • add missing dependencies

v2.0.11 - 01.10.2018

  • add missing dependencies

v2.0.12 - 01.10.2018

  • improve settings page
  • verbose forced disconnect from BLE after error

v2.0.13 - 20.10.2018

  • filter the existing devices out of the device list on pairing
  • add readable time format to HTML report

v2.0.14 - 24.10.2018

  • throw error and stop loading if no devices can be found

v2.0.15 - 11.11.2018

  • add version number app for logging
  • improve check on available settings
  • make html rapport generating optional
  • add uuid to device settings for flora sensor

v2.0.16 - 11.11.2018

  • resolved ManagerSettings get exception
  • improve handling exceptions
  • limit timeout by 5 seconds
  • use a different strategy based on homey version

v2.0.17 - 11.12.2018

  • add BLE permission into manifest

v2.0.18 - 12.12.2018

  • removed BLE permission into manifest due to incompatibility with < v2.0.0

v2.0.19 - 21.12.2018

  • removed html report to prevent cpu warns
  • changed version number strategy because it failed with on 2.0.0
  • try to resolve not setting a timer on exception issue

v2.1.0 - 11.01.2019

v2.1.1 - 05.03.2019

  • refactor to the previous iteration strategy

v2.1.2 - 14.03.2019

  • connect to service directly

v2.1.3 - 15.03.2019

  • fixed bug that gives an error on pairing
  • moved update sequence to app to centralize
  • add callback on added device so updating starts right away

v2.1.4 - 15.03.2019

  • add identify possibility into settings
  • add initializing the retry counter before fail scenario
  • improve catching the exceptions within the handling function

v2.1.4 - 15.03.2019

  • add identify possibility into settings

v2.1.5 - 17.03.2019

  • bump version due to invalid build

v2.1.6 - 22.03.2019

  • call the callback after saving the settings to prevent throwing an error
  • change the min/max to better threshold

v2.1.7 - 20.04.2019

  • removing the update device after pairing #70
  • renaming condition cards because of unknown behaviour #71

v2.1.8 - 20.04.2019

  • bump version v2.1.7 because its is rejected from the store somehow

v2.1.9 - 27.04.2019

  • try to discovery services with every update to prevent sequence bug (only compatible with >=2.1.2 because of the timout bug

v2.1.10 - 15.05.2019

v2.1.11 - 27.07.2019

  • add german translations (thanks to JackDaniel007)

v2.1.12 - 04.02.2020

  • fixed capital case translation issues
  • fixed translation #81

v2.1.13 - 02.04.2020

v3.0.0 - 22.11.2020

  • add support for SDK 3
  • add default threshold settings
  • refactoring pair logic
  • improve brand look & feel

v3.0.1 - 04.12.2020

  • display negative temperature correctly
  • add todo for next release
  • change brand color and translations

v3.0.2 - 22.02.2021

  • add trigger card: 'Synchronise all sensor values with Homey'
  • filter known devices when pairing
  • add debounce for updating all the devices

v3.0.3 - 10.03.2021

  • bugfix when sync is in progress in action card 'Synchronise all sensor values with Homey'

v3.0.4 - 29.03.2021

  • bugfix no results when pairing and sync is in progress

v4.0.0 - 14.07.2021

  • bugfix DE translation issue #101
  • migrate capabilities to correct homey syntax #103

v4.0.1 - 19-01-2020

  • add numeric value to flowcards: #105
  • add german translations

v4.0.2 - 28-01-2020

  • add german translations
  • feedback Athom

v4.0.3 - 14-06-2022

  • add support for Xiaomi mi flora care max
  • add update device action

v4.0.4 - 14-06-2022

  • resolved path for driver

v4.0.5 - 14-06-2022

  • add debug information

v4.0.6 - 14-06-2022

  • block zero values from flora max

v4.0.7 - 30-03-2023

  • add changes for Homey 2023

v4.0.8 - 30-03-2023

  • bump version

v4.1.2 - 15-05-2024

  • add alarm capabilities

Final note

The repository is available at: https://github.com/koktaildotcom/homey-mi-flora

homey-mi-flora's People

Contributors

cbho avatar dependabot[bot] avatar dijker avatar dirkg173 avatar johngeorgiadis avatar koktaildotcom avatar lavve avatar tedtolboom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

homey-mi-flora's Issues

Doesn't seem to update

Hi koktaildotcom,

There seems to be a problem with the app. It doesn't update the values once it's started. I have to restart the app in order to make it fetch new readings. It will read the sensors once, then just stops updating.

Once you restart the app every 15 minutes (currently done with the new System experiment Flow card action to restart the app), it seems to work more or less (have this in place as of 14:00). But that really shouldn't have to be done to make it update.

The refresh setting does not fix anything. Tried values of 10 minutes, 15 minutes and 30 minutes. All would not update any sensor data after first fetch.

Installed latest beta version of app (2.1.0) and latest Homey rc (2.0.5.rc2).

screenshot 2019-03-05 at 16 33 22

Edit: just noticed this notice;

The app is rewrited for v2.0 but does update just once due to Homey core issues as mentioned in de skd-app issue ticket to athom on github. Athom is looking for a fix for this issue ‘soon’ untill than the app wil not be fully compatibel with v2.0.

Well, that seems to answer it. At least the workaround seems to work for now. I'll just await Athom's fix patiently. :-)

Add information on the pairing screen

In the pairing screen with homey its just says "follow the instruction"

Change to a information section with tips and qa's like:

If the sensor cannot by found, check if the sensor is connected to another bluetooth device.
For optimal signal strength keep the sensor within a close distance of homey.
Always download the native mi app. this will update the sensor to the latest firmware.

Add trigger card with summary.

I want to make an trigger card (when) with the complete status of all the devices.

Flora sensor 1

  • De plant {plantname} has not enough fertilizer.
  • De plant {plantname} has not enough water.

Flora ropot 1

  • De plant {plantname} has not enough sunlight.

Then there is a possibility to make a flow:

When status raport is available ($status_raport) -> And it is 9:00 pm on saterday -> Send notification to phone ($status)

Missing permission: homey:wireless:ble

I update my homey to 2.0 today and my flora sensor have stopt working. I removed the sensor and tried to add it but i got error. Tried reintall but it faild again
The error code is:
Error: missing_permission:homey:wireless:ble

Mobile interface not shown in new (beta) app

Hi @koktaildotcom,

Great app, thanks for the effort.

I noticed that the mobile interface is showing correctly on the old web interface:
schermafbeelding 2018-04-10 om 08 00 08

But on the new (beta) app, the interface only shows a blank screen (adding a screenshot doesn't make sense).
I tried to optimize the icons (with illustrator) to check if that resolves this issue (see PR#2), but that is not the case...

I'll see if I can look into it this evening.

PS. I would propose to setup a paypalme account and replace your current contribution link to that one; saves Paypal fees... ;-P

App crash due to missing condition card arguments

Hi! Unfortunately, the app crashed while I was doing the following: (...) This is the stack trace: /lib/MiFloraDevice.js:300 let minValue = args.device.getSetting(this._thresholdMapping[capability].min); ^ TypeError: args.device.getSetting is not a function at Homey.FlowCardCondition.register.registerRunListener (/lib/MiFloraDevice.js:300:52) at FlowCardCondition._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/FlowCard.js:1:1246) at emitThree (events.js:136:13) at FlowCardCondition.emit (events.js:217:7) at ManagerFlow._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/flow.js:1:2274) at _eventListeners.filter.forEach.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1219) at Array.forEach () at HomeyClient._onMessage (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1196) at emitTwo (events.js:126:13) at process.emit (events.js:214:7)

Add a check on `args.device` is not null before getting the minValue

/lib/MiFloraDevice.js:301
let minValue = args.device.getSetting(this._thresholdMapping[capability].min);
^

TypeError: args.device.getSetting is not a function
at Homey.FlowCardCondition.register.registerRunListener (/lib/MiFloraDevice.js:301:56)
at FlowCardCondition._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/FlowCard.js:1:1246)
at emitThree (events.js:136:13)
at FlowCardCondition.emit (events.js:217:7)
at ManagerFlow._onRun (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/manager/flow.js:1:2274)
at _eventListeners.filter.forEach.t (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1219)
at Array.forEach ()
at HomeyClient._onMessage (/opt/homey-client/system/manager/ManagerApps/bootstrap/sdk/v2/lib/HomeyClient.js:1:1196)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)

Add local tag of zone

Can you please add a local tag available for flows telling what zone the sensor is in? As I have multiple sensors, and some of them are monitoring the same type of plant.

Trigger "sensor below value" releases even if value is above high value.

Trigger for plant X: "Sensor value is below the configured threshold" + "The plant has not enough moisture" -> Alarm
results even in an alarm if moisture is above threshold: low = 20, high = 80 ... after watering the plant, the moisture value was above 80 and the alarm was released every time, the sensor was refreshed. After some hours the value droped below 80 and no alarm was send any more.

Data is not updated regularly from the sensor

Hi,

I have a Xiaomi minflora ( Chinese edition)a few days.
At the beginning there where no problems it was updated regularly but now the updates intervals are like 8 or 9 hours.

I’ve tryide to change the setting no effect,
I’ve rebooted the sensor no effect,
I’ve changed the settings because I thought there was an issue with the range no problem every change is saved without time out.

Homey firmware is: 2.1.2
App ver: 2.1.10
Mi Flora firmware: 3.2.1
Log id: f98be123-522c-48da-b42c-d46c9c988c82

I hope you can see what’s wrong

Kind regards,
Kamil Kuchta

No Data from sensor

I'm getting no data from my sensor. In the app everything is working fine.

Too many settings available for RoPot

Under settings for RoPots, it is possible to add limits for "luminance".
However, RoPots unfortunately haven't got that capability.
Suggest deleting the setting as I guess it could be confusing in some cases.

Updating Sensors don´t work

I have 7 Xiaomi Sensors, and if i install the app new, and registering the 7 Sensors, the App will be work for About 1 day.
In the Settings you can choose the intervall of updating the sensors. I have set this value to 60 Minutes for now, but it won´t update the sensor data.
If i Restart the app, Nothing apears.
If i restard Homey, 1 or 2 Sensors have new data, the rest not.
How did you pull the sensor data ??? All at one time ??? What happend, when you can´t connect to one of These sensors ??? Will you try the other sensors, or will the app stop ???
In my opinion 2 new values in the General Settings make sense.

Number of retrays if something went wrong.

Delay between the poll from sensor to sensor. (If i have a pollingvalue of Default 15 minutes, then the second value can be 30 seconds, that means a delay before the second,third…. sensor datas are requested)

I have some other Bluetooth LE devices (Mipow), and there was a solution, to put a delay between the pull of the devices, if you have more than one.

Best regards, and thank you for coding such a nice app. :-)

Polling interval not working

since 2 months or so, the polling interval does not work.
it does not matter if i let the interval on default or set it to a specific time, it does not refresh.
once i restart the app, the information is collected.
any ideas on what i might be doing wrong, or could this be fixed ?

kind regards,
Ziglar

lost connection

distance of 3-5 metres. chart
homey 1.5.11
app version v2.0.2
firmware version 3.1.8 and 2.7.0

[enhancement] add validation on device setting (min/max).

Suggestion:
When adding a minimum value, the max value is automatically changed to being at least 1 higher than that.
Would prevent a situation with "impossible" values (having a maximum limit that is lower than the lower limit).
Not a big deal, just an idea ;-)

Sensors not working after few hours

Hi, great app! Worked like a charm!
But after only few hours sensors both stop working. No update anymore. Last update of both sensors is 2 days ago.

Anything to do with setting of treshold values?

Treshold values set manually, poll interval 30min. Furthermore I am restarting the app every night via homey flow.

Homey firmware is: 2.1.2
App ver: 2.1.10
Mi Flora firmware: 3.2.1

Issue report
3353ab2f-a193-4955-a999-ce1d132df65f

Any idea how to get and keep this working?!

Naming of variables

The used nomenclature for variables in the app include that the measured values are named with the prefix "measure_" - this means, that if the token "sensor" is used to compose a log message like shown in the example below, text will be "[Device name]: measure_moisture is too low ([value])".

ex-1

Although the logic in naming the variable is obvious and has many advantages, I suggest the variables for the measured values are names without the prefix (only "moisture", e.g.) in order to make composed messages more "clean" and ordinary language-like.
This would also prevent the situation that a message read out would like "[Device name]: measure-underscore-moisture is too low ([value] :-)

Issue with updating

When updating v2.0.15 towards v2.0.17 it does not purge the app and gives this error message

afbeelding

Data sync causes timeout

If you pair more than 7 devices at once, the BLE gives a timeout. Stop update on pairing, but trigger an update event in the app.

No data received with sensor mi-flora v2.3.0

I am using version 2.1.13 from the homey xiaomi mi flora.

I have 2 sensors hhcc from xiaomi. Both are working fine in the app vegtrug grow care. I updated both to the latest version which is 2.3.0.

image

When adding both sensors to homey they are found. And displayed in the devices tab of homey app.

When selecting one no data is shown. The orher one has the same issue.

image

image

image

I have made a homey diagnostic report 0e371201-6da3-4148-a63d-2c6c7def2775.

With older software versions of the sensors data was shown bit never updated.

Let me know if you need some more information.

Rgds dirk

Can't add sensors (permission problem?)

When trying to add a sensor it returns a message:

"Cannot get devices:Cannot discover BLE devices from the Homey manager. Error: missing_permission:Homey:wireless:ble"

App needs additional permission on v.2.0.0

After upgrading from 1.5.13 to 2.0.0.rc it looked like everything was workig fine, untill today i didn't notice anything was wrong. But I havent received a message for a while now so I looked at the status. The status was refreshed 9 days ago.

After removing and trying to add the sensor i get the following message:
Cannot get devices:Cannot discover BLE devices from the homey manager. Error: missing_permission:homey:wireless:ble

I recongize this error because BLE Christmas Lights had the same problem. He had to create a new app with permissions specifically set voor v2 firmware.

HomeyKit stops working

When I enable the "Xiaomi Mi Flora" app on my Homey my "HomeyKit" app stops working. I can see when sensors are triggered in HomeKit, but I can´t turn on/off lights for instance. As soon as I Disable the "Xiaomi Mi Flora" app the Homekit integration starts to work again. I use 1.5.13 on my Homey and 2.0.18 on the Xiaomi Mi Flora App.

Connection issue after moving flora device out of reach (I think)

Have an issue with the MI flora device. Worked for quite some time and was providing steady data. I had to relocate one plant because we're preparing for a move to another house. I think the MI flora was out of reach for a bit too long. Haven't been able to read new values ever since. Please help.
dc6756a3-fc0e-420e-a95f-e426f3119453

App has stopped working with Homey v2.4.1

This app has stopped working after Homey got updated to version 2.4.1. The app is running, but no reports are coming from any of the devices connected using this app.

Threshold update Unknown_Error

Great app, thank you for that. When adding (min or max) thresholds values in advanced settings an error occurs when submitting it to the device. "An unknown error has occured [unkown error]". Firmware version 3.2.1 / Diagnostic rapport: 6346f9f6-e6a5-41ec-bfbd-230be23248ed.

Trigger card: close to treshhold

Hi,
was wondering if it would be possible to add another trigger card with something like "Sensor value within X of configured threshold" - that is, within the configured interval, but closing in on the limit...

That would allow for setting the limits for moisture etc. for each sensor corresponding to the plant and be able to make not only a flow triggered by the moisure (e.g.) being outside the limits, but also to make flows that trigger when you are getting close - that is, make it possible to react in due time instead of (kind of) too late...

Of course, flows can be made that correspond to a specific sensor - but a card using or more generic approach would allow for fewer flows :-)

Add custom capabilities to homey insights

https://community.athom.com/t/xiaomi-mi-flora-sensor-ropot-app/45/174?u=koktail

Feature request:
Can you add the humidity value of stick sensor to homey insights?

Reason:
Gives me the opportunity to check if automatic watering works when on holiday (not in use when at home because of hideous looks in kitchen, reason why next point is still valid)
Point out to wife she ignored notifications on her phone to water plants.
Establish a relation between watering and soil moisture. (Some people may call that Evapotranspiration or ET)

Homey doesn't find Mi Flora sensor

The sensor is not found by the Homey app.

  • It is found by the app from mi flora itself
  • I have removed it from the app after i checked if the firmware was up to date.
  • I have it next to the Homey (within 10cm) when trying to connect

What else can i try?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.