Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Moderator: leecollings
-
- Posts: 68
- Joined: Wednesday 03 February 2016 19:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I'm trying to install your script on my fresh Domoticz installation.
I followed the wiki, changed my domoticz server with username and password.
At the botom deleted all predifind sensor and added only my first sensor:
With the IDX numbers from the devices list and bluetooth adre.s
print("\n1: Anthurium (Anthurium)")
update("C4:7C:8D:65:CC:27","139","142","141","143")
When executing i get the following error:
1: Anthurium (Anthurium)
Mi Flora: C4:7C:8D:65:CC:27
Firmware: 2.7.0
Name: Flower care
Temperature: 26.9°C
Moisture: 7%
Light: 1995 lux
Fertility: 5 uS/cm?
Battery: 100%
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 694, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/domoticz/scripts/python/miflora/domoticz.py", line 97, in <module>
update("C4:7C:8D:65:CC:27","139","142","141","143")
File "/home/pi/domoticz/scripts/python/miflora/domoticz.py", line 79, in update
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_temp + "&nvalue=0&svalue=" + val_temp + "&battery=" + val_bat)
File "/home/pi/domoticz/scripts/python/miflora/domoticz.py", line 30, in domoticzrequest
response = urllib.request.urlopen(request)
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>
Can someone point me the good direction?
Could it be related to Python version 3.5? Wich version is recommend?
I followed the wiki, changed my domoticz server with username and password.
At the botom deleted all predifind sensor and added only my first sensor:
With the IDX numbers from the devices list and bluetooth adre.s
print("\n1: Anthurium (Anthurium)")
update("C4:7C:8D:65:CC:27","139","142","141","143")
When executing i get the following error:
1: Anthurium (Anthurium)
Mi Flora: C4:7C:8D:65:CC:27
Firmware: 2.7.0
Name: Flower care
Temperature: 26.9°C
Moisture: 7%
Light: 1995 lux
Fertility: 5 uS/cm?
Battery: 100%
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 694, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/domoticz/scripts/python/miflora/domoticz.py", line 97, in <module>
update("C4:7C:8D:65:CC:27","139","142","141","143")
File "/home/pi/domoticz/scripts/python/miflora/domoticz.py", line 79, in update
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_temp + "&nvalue=0&svalue=" + val_temp + "&battery=" + val_bat)
File "/home/pi/domoticz/scripts/python/miflora/domoticz.py", line 30, in domoticzrequest
response = urllib.request.urlopen(request)
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>
Can someone point me the good direction?
Could it be related to Python version 3.5? Wich version is recommend?
-
- Posts: 234
- Joined: Sunday 27 August 2017 18:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Spain
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
hello.
now i have this working fine, i follow the tutorial in wiki and is perfect!!!
But i have a question, the sensor i configure 4 info that the sensor send to domoticz:
- humidity
- fertility
- temperature
- lux
but i see that the script can send the battery status too?
what changes i need to do in the scripts to obtaint the battery status? (in the tutorial not say nothing )
thanks!
now i have this working fine, i follow the tutorial in wiki and is perfect!!!
But i have a question, the sensor i configure 4 info that the sensor send to domoticz:
- humidity
- fertility
- temperature
- lux
but i see that the script can send the battery status too?
what changes i need to do in the scripts to obtaint the battery status? (in the tutorial not say nothing )
thanks!
-
- Posts: 3
- Joined: Sunday 08 October 2017 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
hello,
we have a problems,
anyone can help me?
1: Capteur 3
Mi Flora: C4:7C:8D:62:X3:XX
Firmware: 3.1.4
Name: Flower care
Temperature: 15.9°C
Moisture: 11%
Light: 5907 lux
Fertility: 67 uS/cm?
Battery: 99%
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "domoticz.py", line 98, in <module>
update("C4:7C:8D:62:X3:XX","50","52","53","51")
File "domoticz.py", line 78, in update
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_temp + "&nvalue=0&svalue=" + val_temp + "&battery=" + val_bat)
File "domoticz.py", line 29, in domoticzrequest
response = urllib.request.urlopen(request)
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
thx
we have a problems,
anyone can help me?
1: Capteur 3
Mi Flora: C4:7C:8D:62:X3:XX
Firmware: 3.1.4
Name: Flower care
Temperature: 15.9°C
Moisture: 11%
Light: 5907 lux
Fertility: 67 uS/cm?
Battery: 99%
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "domoticz.py", line 98, in <module>
update("C4:7C:8D:62:X3:XX","50","52","53","51")
File "domoticz.py", line 78, in update
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_temp + "&nvalue=0&svalue=" + val_temp + "&battery=" + val_bat)
File "domoticz.py", line 29, in domoticzrequest
response = urllib.request.urlopen(request)
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
thx
Last edited by empreur76 on Sunday 08 October 2017 19:25, edited 1 time in total.
-
- Posts: 68
- Joined: Wednesday 03 February 2016 19:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I have simular python issues...
I think it is related to my fresh Jessie, domoticz installation.
did you did a fresh install or update?
I think it is related to my fresh Jessie, domoticz installation.
did you did a fresh install or update?
empreur76 wrote: ↑Sunday 08 October 2017 17:53 hello,
we have a problems,
anyone can help me?
1: Capteur 3
Mi Flora: C4:7C:8D:62:X3:XX
Firmware: 3.1.4
Name: Flower care
Temperature: 15.9°C
Moisture: 11%
Light: 5907 lux
Fertility: 67 uS/cm?
Battery: 99%
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
thx
-
- Posts: 153
- Joined: Monday 17 February 2014 9:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
the battery status is shown in the normal domoticz way
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Hi all. I'm trying to let Mi Flora work, but with no success. I have other BLE devices, Nut, working.
I get some errors, sometimes "device busy" other "no route to host". Any advice?
I'm on Domoticz latest beta and Bluez latest version.
Thanks
I get some errors, sometimes "device busy" other "no route to host". Any advice?
I'm on Domoticz latest beta and Bluez latest version.
Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 3
- Joined: Sunday 08 October 2017 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
yes ,
a fresh install of jessie
quote=joostnl post_id=153288 time=1507478680 user_id=8817]
I have simular python issues...
I think it is related to my fresh Jessie, domoticz installation.
did you did a fresh install or update?
a fresh install of jessie
quote=joostnl post_id=153288 time=1507478680 user_id=8817]
I have simular python issues...
I think it is related to my fresh Jessie, domoticz installation.
did you did a fresh install or update?
[/quote]empreur76 wrote: ↑Sunday 08 October 2017 17:53 hello,
we have a problems,
anyone can help me?
1: Capteur 3
Mi Flora: C4:7C:8D:62:X3:XX
Firmware: 3.1.4
Name: Flower care
Temperature: 15.9°C
Moisture: 11%
Light: 5907 lux
Fertility: 67 uS/cm?
Battery: 99%
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
thx
-
- Posts: 68
- Joined: Wednesday 03 February 2016 19:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Can someone post a jessie image with domoticz and python with bluez installed? (I got raspberry on 2b) I think If you start fresh and follow the wiki it not going to work. I think it is related to latest jessie or python.. I spend hours retrying but no luck
[/quote]empreur76 wrote: ↑Sunday 08 October 2017 19:24 yes ,
a fresh install of jessie
quote=joostnl post_id=153288 time=1507478680 user_id=8817]
I have simular python issues...
I think it is related to my fresh Jessie, domoticz installation.
did you did a fresh install or update?
empreur76 wrote: ↑Sunday 08 October 2017 17:53 hello,
we have a problems,
anyone can help me?
1: Capteur 3
Mi Flora: C4:7C:8D:62:X3:XX
Firmware: 3.1.4
Name: Flower care
Temperature: 15.9°C
Moisture: 11%
Light: 5907 lux
Fertility: 67 uS/cm?
Battery: 99%
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
thx
-
- Posts: 3
- Joined: Sunday 08 October 2017 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
hello,
we have change my Raspberry ip to 127.0.0.1 into the script and all it's ok for me.
we have change my Raspberry ip to 127.0.0.1 into the script and all it's ok for me.
-
- Posts: 73
- Joined: Saturday 07 November 2015 10:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Poland
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
RaspberryPi 3, Raspbian Stretch.
I follow the wiki, all installation, coping, making etc went fine, but I stuck on "Finding the sensor's Bluetooth Address". Got this error messages:
Can anyone help me please?
I follow the wiki, all installation, coping, making etc went fine, but I stuck on "Finding the sensor's Bluetooth Address". Got this error messages:
Code: Select all
pi@raspberrypi:~/bluez-5.44 $ sudo tools/btmgmt le on
Set Low Energy for hci0 failed with status 0x11 (Invalid Index)
- remb0
- Posts: 499
- Joined: Thursday 11 July 2013 22:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I see that the original github code is forked many times (with improvements) maybe it's handy to check if the forks are better?
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I saw too that a day ago there were some improvements on github.
I've tried to understand where are the changes and where to help make to change here, but I'm not an expert coder.
I saw that there is an index.js with this description, "Fixing the odd value reading."
If I can be any help let me know.
Thanks
I've tried to understand where are the changes and where to help make to change here, but I'm not an expert coder.
I saw that there is an index.js with this description, "Fixing the odd value reading."
If I can be any help let me know.
Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 73
- Joined: Saturday 07 November 2015 10:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Poland
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
really no one has such error?IDANIT wrote: ↑Monday 09 October 2017 19:16 RaspberryPi 3, Raspbian Stretch.
I follow the wiki, all installation, coping, making etc went fine, but I stuck on "Finding the sensor's Bluetooth Address". Got this error messages:Can anyone help me please?Code: Select all
pi@raspberrypi:~/bluez-5.44 $ sudo tools/btmgmt le on Set Low Energy for hci0 failed with status 0x11 (Invalid Index)
-
- Posts: 68
- Joined: Wednesday 03 February 2016 19:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Thank you! Changing my ip to the script, WITHOUT http:// did the trick.
So at ip: 192.168.2.13 (for me my domoticz ip)
I only get this warnings sometimes:
~/bluez-5.44 $ connect error: Transport endpoint is not connected (107)
/bluez-5.44 $ sudo hcitool lescan Set scan parameters failed: Input/output error
But after:
pi@raspberrypi:~/bluez-5.44 $ sudo hciconfig hci0 down
pi@raspberrypi:~/bluez-5.44 $ sudo hciconfig hci0 up
Everything is working again, more people with this issue?
-
- Posts: 26
- Joined: Thursday 04 February 2016 13:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.530
- Location: Emmen, Drenthe
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I have three MiFlora Plant Sensors, which are working fine with this script. I'm thinking about ordering the RoPot as well, is this device supported by the script?
-
- Posts: 11
- Joined: Wednesday 30 December 2015 9:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.8153
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
I got my first Mi Flora yesterday and thanks to the Wiki, installation went (almost) flaweless!
My dummy sensor for logging moisture didn't update to the correct value (was always 0), and when I looked in the domoticz.py script, I noticed the URL was formatted incorrect. I modified the script so it also supports changing the status to Normal, Dry or Wet. Reading through the previous pages I assumed 20 is the right trigger for setting the status to Dry.
Original code:
Modified to (where svalue 3 is Wet and svalue 2 is Dry):
My dummy sensor for logging moisture didn't update to the correct value (was always 0), and when I looked in the domoticz.py script, I noticed the URL was formatted incorrect. I modified the script so it also supports changing the status to Normal, Dry or Wet. Reading through the previous pages I assumed 20 is the right trigger for setting the status to Dry.
Original code:
Code: Select all
# Update moisture
val_moist = "{}".format(poller.parameter_value(MI_MOISTURE))
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_moist + "&svalue=" + val_moist + "&battery=" + val_bat)
Code: Select all
# Update moisture
val_moist = "{}".format(poller.parameter_value(MI_MOISTURE))
if int(val_moist) >= 60:
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_moist + "&nvalue=" + val_moist + "&svalue=3")
elif int(val_moist) <= 20:
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_moist + "&nvalue=" + val_moist + "&svalue=2")
else:
domoticzrequest("http://" + domoticzserver + "/json.htm?type=command¶m=udevice&idx=" + idx_moist + "&nvalue=" + val_moist + "&svalue=0")
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Hi,
Trying to use MI Flora/Flower Care with Domoticz, devices are OK/detecte under Domoticz but problem is more with this Bluetooth connection/distance from my Linux PC and the Mi Flora ... (same problem from the phone with FlowerCare application if I'm too far from the Mi Flora).
I'm also owning a XIaomi Gateway with door sensors, ceiling lamp and my interrogation is : MiFlora/Flower Care is displayed/detected under Mi Home application and I was wondering if it was possible to grab all values from MiFlora though the Xiaomi Gataway like it is possible for Door Sensors, ceiling lamp ... etc ... My Xiaomi Gateway is in the same room as my Mi Flora.
Thanks for your suggestions.
Regards,
Laurent
Trying to use MI Flora/Flower Care with Domoticz, devices are OK/detecte under Domoticz but problem is more with this Bluetooth connection/distance from my Linux PC and the Mi Flora ... (same problem from the phone with FlowerCare application if I'm too far from the Mi Flora).
I'm also owning a XIaomi Gateway with door sensors, ceiling lamp and my interrogation is : MiFlora/Flower Care is displayed/detected under Mi Home application and I was wondering if it was possible to grab all values from MiFlora though the Xiaomi Gataway like it is possible for Door Sensors, ceiling lamp ... etc ... My Xiaomi Gateway is in the same room as my Mi Flora.
Thanks for your suggestions.
Regards,
Laurent
-
- Posts: 68
- Joined: Wednesday 03 February 2016 19:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
This would be great
lolomin wrote: ↑Sunday 14 January 2018 1:12 Hi,
Trying to use MI Flora/Flower Care with Domoticz, devices are OK/detecte under Domoticz but problem is more with this Bluetooth connection/distance from my Linux PC and the Mi Flora ... (same problem from the phone with FlowerCare application if I'm too far from the Mi Flora).
I'm also owning a XIaomi Gateway with door sensors, ceiling lamp and my interrogation is : MiFlora/Flower Care is displayed/detected under Mi Home application and I was wondering if it was possible to grab all values from MiFlora though the Xiaomi Gataway like it is possible for Door Sensors, ceiling lamp ... etc ... My Xiaomi Gateway is in the same room as my Mi Flora.
Thanks for your suggestions.
Regards,
Laurent
-
- Posts: 20
- Joined: Thursday 29 December 2016 9:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
The present Xiaomi Gateway does not handle Bluetooth so it is not possible. The reason you see the Flower sensors in the Xiaomi app is because your phone or pad has a direct connection to it (try turning off BT and you will find out).joostnl wrote: ↑Sunday 14 January 2018 7:37 This would be great
lolomin wrote: ↑Sunday 14 January 2018 1:12 Hi,
Trying to use MI Flora/Flower Care with Domoticz, devices are OK/detecte under Domoticz but problem is more with this Bluetooth connection/distance from my Linux PC and the Mi Flora ... (same problem from the phone with FlowerCare application if I'm too far from the Mi Flora).
I'm also owning a XIaomi Gateway with door sensors, ceiling lamp and my interrogation is : MiFlora/Flower Care is displayed/detected under Mi Home application and I was wondering if it was possible to grab all values from MiFlora though the Xiaomi Gataway like it is possible for Door Sensors, ceiling lamp ... etc ... My Xiaomi Gateway is in the same room as my Mi Flora.
Thanks for your suggestions.
Regards,
Laurent
However I heard there was a new Xiaomi Gateway coming supporting BT so maybe with that one.
Re: Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
Hi,Spitfire wrote: ↑Sunday 14 January 2018 8:05The present Xiaomi Gateway does not handle Bluetooth so it is not possible. The reason you see the Flower sensors in the Xiaomi app is because your phone or pad has a direct connection to it (try turning off BT and you will find out).joostnl wrote: ↑Sunday 14 January 2018 7:37 This would be great
lolomin wrote: ↑Sunday 14 January 2018 1:12 Hi,
Trying to use MI Flora/Flower Care with Domoticz, devices are OK/detecte under Domoticz but problem is more with this Bluetooth connection/distance from my Linux PC and the Mi Flora ... (same problem from the phone with FlowerCare application if I'm too far from the Mi Flora).
I'm also owning a XIaomi Gateway with door sensors, ceiling lamp and my interrogation is : MiFlora/Flower Care is displayed/detected under Mi Home application and I was wondering if it was possible to grab all values from MiFlora though the Xiaomi Gataway like it is possible for Door Sensors, ceiling lamp ... etc ... My Xiaomi Gateway is in the same room as my Mi Flora.
Thanks for your suggestions.
Regards,
Laurent
However I heard there was a new Xiaomi Gateway coming supporting BT so maybe with that one.
Thanks for this answer, this is a good reason why it can't be working for the moment
Regards,
lolo
Who is online
Users browsing this forum: Google [Bot] and 0 guests