When it's ready, that will be my prompt switch to RFLinkStuntteam wrote:Yes..
Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Moderator: leecollings
- LouiS22
- Posts: 433
- Joined: Friday 27 February 2015 13:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Budapest, Hungary
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
- jadon
- Posts: 7
- Joined: Monday 07 November 2016 14:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Tiel, Netherlands
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I received my Xiaomi Mi Flora yesterday! I've only had a few minutes to play with it. Connecting with my phone was easy, as you'd expect with a bluetooth LE device. However, I downloaded the Xiaomi Home app and noticed the Flora dashboard is Chinese only So I couldn't tell what's what... Anyway, I'll have a look at reading data with that github script this weekend and see if it makes any sense
- LouiS22
- Posts: 433
- Joined: Friday 27 February 2015 13:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Budapest, Hungary
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Could you please explore the device's range? For example, if you put the sensor into a corner will you phone's able to get the reading from another room, or another floor, etc?jadon wrote:I received my Xiaomi Mi Flora yesterday! I've only had a few minutes to play with it. Connecting with my phone was easy, as you'd expect with a bluetooth LE device. However, I downloaded the Xiaomi Home app and noticed the Flora dashboard is Chinese only So I couldn't tell what's what... Anyway, I'll have a look at reading data with that github script this weekend and see if it makes any sense
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I got mine today. Transmission of the data over a free air distance of 10m worked fine. iOS App is in English and Chinese. Have to wait for the arrival of a HM-11 BLE module to continue with reading the sensors data by an own application...
- jadon
- Posts: 7
- Joined: Monday 07 November 2016 14:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Tiel, Netherlands
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
The range is quite good! I live in an old house (so no concrete walls). I have my Mi Flora in the living room and my raspberry pi 3 in the hallway. I could even connect from my laptop on the 2nd floor.
Anyway, using "sudo hcitool lescan" it lists my device:
Next, I cloned the repository from https://github.com/open-homeautomation/miflora
I changed the MAC address in demo.py and started the script. After 30 seconds or so, I got the following data:
So what's next?
Anyway, using "sudo hcitool lescan" it lists my device:
Code: Select all
pi@domoticz:~/miflora$ sudo hcitool lescan
LE Scan ...
C4:7C:8D:--:--:-- Flower care
I changed the MAC address in demo.py and started the script. After 30 seconds or so, I got the following data:
Code: Select all
pi@domoticz:~/miflora$ python3 demo.py
Getting data from Mi Flora
FW: 2.6.6
Name: Flower care
Temperature: 19.4
Moisture: 9
Light: 201
Conductivity: 0
Battery: 100
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
You can store them in virtual sensors
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
- jadon
- Posts: 7
- Joined: Monday 07 November 2016 14:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Tiel, Netherlands
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
okay, so I create a dummy hardware device and called it "Flower care"
Then I added three virtual sensors: Temp, Lux and Moisture
I copied the demo.py script to domoticz.py and added some code (Python is not my native programming language, so suggetions are welcome)
Using a cronjob I run this script every hour and my sensors get updated
I don't know how long the battery is going to last. It looks like it drains 1% every time I do a read out....
Note: I'm using python3
Then I added three virtual sensors: Temp, Lux and Moisture
I copied the demo.py script to domoticz.py and added some code (Python is not my native programming language, so suggetions are welcome)
Code: Select all
import urllib.request
import base64
from miflora.miflora_poller import MiFloraPoller, \
MI_CONDUCTIVITY, MI_MOISTURE, MI_LIGHT, MI_TEMPERATURE, MI_BATTERY
# Settings for the domoticz server
domoticzserver = "localhost:8080"
domoticzusername = "admin"
domoticzpassword = "----"
# Sensor IDs
idx_temp = "88"
idx_lux = "89"
idx_moist = "90"
############
base64string = base64.encodestring(('%s:%s' % (domoticzusername, domoticzpassword)).encode()).decode().replace('\n', '')
def domoticzrequest (url):
request = urllib.request.Request(url)
request.add_header("Authorization", "Basic %s" % base64string)
response = urllib.request.urlopen(request)
return response.read()
poller = MiFloraPoller("C4:7C:8D:61:F7:2A")
#print("Getting data from Mi Flora")
#print("FW: {}".format(poller.firmware_version()))
#print("Name: {}".format(poller.name()))
#print("Temperature: {}".format(poller.parameter_value("temperature")))
#print("Moisture: {}".format(poller.parameter_value(MI_MOISTURE)))
#print("Light: {}".format(poller.parameter_value(MI_LIGHT)))
#print("Conductivity: {}".format(poller.parameter_value(MI_CONDUCTIVITY)))
#print("Battery: {}".format(poller.parameter_value(MI_BATTERY)))
val_bat = "{}".format(poller.parameter_value(MI_BATTERY))
# Update temp
val_temp = "{}".format(poller.parameter_value("temperature"))
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_temp + "&nvalue=0&svalue=" + val_temp + "&battery=" + val_bat)
# Update lux
val_lux = "{}".format(poller.parameter_value(MI_LIGHT))
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_lux + "&svalue=" + val_lux + "&battery=" + val_bat)
# Update moisture
val_moist = "{}".format(poller.parameter_value(MI_MOISTURE))
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_moist + "&nvalue=" + val_moist + "&battery=" + val_bat)
I don't know how long the battery is going to last. It looks like it drains 1% every time I do a read out....
Note: I'm using python3
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Great script, can do the job on my side waiting for a better BLE integration on RFLink.
Why don't you use a virtual leaf sensor ? Icon is more revelante.
As this is for a plant care, maybe run script twice a day (at mid day and before sunset) can be more usefull and battery friendly.
Why don't you use a virtual leaf sensor ? Icon is more revelante.
As this is for a plant care, maybe run script twice a day (at mid day and before sunset) can be more usefull and battery friendly.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Thnx! Script working great
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Yeap thx for the script ! works as perfect !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
i added with a custom sensor...
Code: Select all
idx_cond = "141"
# Update conductivity
val_cond = "{}".format(poller.parameter_value(MI_CONDUCTIVITY))
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_cond + "&svalue=" + val_cond + "&battery=" + val_bat)
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: RE: Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Hey hey same here...trixwood wrote:i added with a custom sensor...
Code: Select all
idx_cond = "141" # Update conductivity val_cond = "{}".format(poller.parameter_value(MI_CONDUCTIVITY)) domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_cond + "&svalue=" + val_cond + "&battery=" + val_bat)
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
What type of device do you use?
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Custom sensor
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I understand I use custom sensor leaf wetness
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
-
- Posts: 19
- Joined: Thursday 03 March 2016 18:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Would it be possible to use more then 1 Mi Flora
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
yes! as many as you like.
Does anybody has some info on how long the battery will last?
Does anybody has some info on how long the battery will last?
- LouiS22
- Posts: 433
- Joined: Friday 27 February 2015 13:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Budapest, Hungary
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
The users manual promises a year, but IMHO it really depends on your using habits: i.e. if you poll the data every minute, it will suck the battery really fast.trixwood wrote:yes! as many as you like.
Does anybody has some info on how long the battery will last?
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
After a week of 1 daily request and first day 15 times it is still 100 full
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
-
- Posts: 12
- Joined: Wednesday 02 November 2016 22:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5877
- Location: South West of France
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Thanks for this script ! It's work perfect.
Now, i need to create a custom sensor (i don't see it.... V3.4834) and a cronjob
Now, i need to create a custom sensor (i don't see it.... V3.4834) and a cronjob
Raspberry Pi 3 - RFLink and Homewizard
Who is online
Users browsing this forum: No registered users and 0 guests