[APP][Pro] Xiaomi mi flora sensor/ropot app

A small note, for me not too important:
A flow like this:
“When a sensor’s value is below the threshold
And the plant has not the right amount of moisture”

It sends also reports about the lux level being too low, while it only should report when the moisture is too low.

Flow:

Report:

That’s not a bug, it does exactly what is should.

When a sensor’s value is below the threshold
And the plant has not the right amount of moisture

So when the plant has not the right amount you get a message from every sensor’s value that is below the threshold.

You should add a condition logic card:
And {tag local sensor type} = ‘moisture’

Thanks for testing! :+1:

1 Like

I was under the impression these were equal conditions.

Can you enlighten why this card exists? I’m confused.
"AND the plant has not the right amount of moisture"
I’m under the impression my flow acts the same without this condition, while other out-of-range sensors besides moisture are a valid condition as well…

Tia.

The trigger card triggers on every sensor. I can imagine that it is confusing. Maybe there should be a triggercard for every sensor type. That way you can use the condition card like you suggested.

That are 4 (sensors) x 3 (below, above and outside) cards, that’s a lot.

The triggercard is clear to me. It just triggers on any sensor above/below/outside range.
The condition is the place where I filter which sensor should report.
That works fine with:
"AND {tag local sensor type} = ‘moisture’ "
It matches only when the moisture is out-of-range, and that is what I want to be notified of.

I was just assuming this condition has an equal result of the logics one:
“AND the plant has not the right amount of moisture”

But, if not the right amount of luminance/nutrition/temperature also exists, those are being reported as well, as you can see on my timeline screenshot.

That makes the
AND the plant has not the right amount of moisture
condition not neccessary imho, b/c it does not filter out the sensors.
The trigger
“IF a sensors value is above/below/out-of-range”
reports if any sensor is in that state, no AND condition needed.

I hope this makes any sense, as we seem to look at it from a different view😊

Thanks and cheers

1 Like

Hi Leendert,

I was reviewing some flows and found that there’s also a global trigger for changed sensor values… Right now I have a flow per sensor (and I have 20) which creates a very long list, I wish to put (almost) all sensors in one flow… I guess the global trigger is good for this.

The only thing I found is that the value (waarde) tag is niet programmable inside a higher/lower logic card. Might this be setup as a string instead of a number?

What do you mean with: Is not programmable? You can use it with a condition card if you like (homey logic/better logic). Changing the ‘value’ to a sting isn’t logical, that way you can’t calculate anything with it for example.

No I ment the other way around, is it maybe currently set to a string and not a number?

When using the global tags choosing “A sensor value changed”, going to the “AND” part and choose “Value is below X” out of the logic cards the tag “moisture” (or any other) is not showing.According to the trigger card it should give me “rapport, waarde, sensor, apparaat”.

Choosing the logic card “is exactly” IS giving me the given tags that the trigger provides.

This indicates to me that the global tags are currently set to string and not number, that’s why they show up in the string related logic cards but not the number logic cards.

I might be completely wrong, but this is the only logical reason I can think about?


Example:

IF A global sensor value has changed
AND The given moisture is below XXX using a logic card
THEN Push message “I’m thirsty!”

This is currently not working since the moisture level is not showing in the logic card.

Using this same method with a device related trigger “the sensor has changed”, soo not the global one, it is possible and working the way it should!

I think you found a bug! I’ll add it to the repository and will fix this when i’m gonna make some changes.

My collegeas always called me “Bugs Bunny”… Not sure if that was because I always found bugs or created them myself, hihi.

For now i’ll keep my “old flows” using a trigger for every device. Could you create a post in this thread when it’s fixed? Then i’ll start building the cleaner way :slight_smile:

1 Like

Sharp observation, Justin.
Unlike you, I encountered the same issue with a device related trigger "a sensor’s value has changed.
IF My Plant X a sensor’s value has changed
AND The given moisture is below XXX using a logic card
THEN Push message “I’m thirsty!”

I worked around this by browsing to the tags/variables at the logics section of the device itself, where the ‘blue’ moisture tag/variable is available, but it should be available at the local tags section.
It can also be viewed when selecting the IF card, all tags are green, while the value (= ‘waarde’ in screenie) tag should be blue.

1 Like

Yes, you’re right… I see now that I also used the global variable “moisture” instead of the trigger flow variable. Wasn’t even aware of that!

In this case it’s not a bad thing, how well it may also be called a “bug” since you’d expect the trigger flow for one single device would give the tag “moisture” as well. But using the global variables is a fine option…

1 Like

@Koktail, might you be interested in teaming up for this app creating a webbased “dashboard” that is able to show the status of all your flowers on your television?

My wife is requesting this and I think it’s a pretty cool idea. I’ve got about 15 sensors now and 5 more are on it’s way. I could create a webbased dashboard that’s listening to a special token and a webhook function, maybe you can create a flow that triggers sending this data towards the dashboard for each sensor, one by one, were the dash picks this up and displays the results one by one?

Users may stream these results through Chromecast towards the television or Google Hub screens…

Edit:
I don’t think it really must be 100% live data… Sending the latest moisture information and a numeric timestamp is fine as well. It gives the home owner a good idea how his plants are doing.

2 Likes

I’ve already made something like that: GitHub - koktaildotcom/homey-mi-flora-dashboard: View the status of Xiaomi Mi Flora Plant Sensors

You can use that to get the data out of homey.

1 Like

Trying to get this working using web api. Only sad thing will always be that you need to set devices twice, would be great if you could just receive every flower sensor and read it.

2 Likes

Looks cool!

You can read the devices straight from the homey API. Thats what is should do. Look at my repository, there is an example how to do it. Index.html:60

There is one thing, the token only has a redirect URL on localhost. So you only can run it as development environment.

You’re now ready for a Homey automated irrigation system!:sunglasses::ok_hand:

I was wondering… How does the app work looking at multiple devices?

I got 5 new sensors today, soo I got many of them now. If the polling interval hits, does it look through sensors one by one? Connecting, reading, disconnecting, connecting … ??

If that’s the case, will the last in list ever get readed when theres a short polling setup? Because it will start over?

one more questions… I am always affraid that some sensors might not have reported. I know that theres a special flow for that in Homey, made by Athom themselves, but could it be possible to add a flow trigger card that will trigger when connection failed? That way you can have a peace of mind that you’re notified when something failes?