When it's ready, that will be my prompt switch to RFLinkStuntteam wrote:Yes..

Moderator: leecollings
When it's ready, that will be my prompt switch to RFLinkStuntteam wrote:Yes..
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 onlySo 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
Code: Select all
pi@domoticz:~/miflora$ sudo hcitool lescan
LE Scan ...
C4:7C:8D:--:--:-- Flower care
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
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)
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)
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)
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?
Users browsing this forum: No registered users and 0 guests