13.01.2020, 21:17
Im working on a BLE profile for the xiaome Mi Flora Flower care sensor, this is as far as i have got, i can read the data but not sure how to extract the data i want from the bytes,
there is available, light level, soil moisture level and temperature, the location of the data is as per the link below.
https://www.open-homeautomation.com/2016...nt-sensor/
require('ble')
ble.up()
sock = ble.sock()
ble.settimeout(sock, 30)
res = ble.connect(sock, "80:EA:CA:88:E5:63")
log(res)
if res then
cmd = 0xA0, 0x1F
--0x03 -- name
re, er = ble.sockwritecmd(sock, 0x33, cmd) -- send the magic to allow us to read the data
log(re, er)
os.sleep(0.1)
x = ble.sockreadhnd(sock,0x35) or ''
a = x:byte(1)
b = x:byte(2)
c = x:byte(3)
d = x:byte(4)
e = x:byte(5)
f = x:byte(6)
g = x:byte(7)
h = x:byte(8)
log(x,a,b,c,d,e,f,g,h)
end
there is available, light level, soil moisture level and temperature, the location of the data is as per the link below.
https://www.open-homeautomation.com/2016...nt-sensor/
require('ble')
ble.up()
sock = ble.sock()
ble.settimeout(sock, 30)
res = ble.connect(sock, "80:EA:CA:88:E5:63")
log(res)
if res then
cmd = 0xA0, 0x1F
--0x03 -- name
re, er = ble.sockwritecmd(sock, 0x33, cmd) -- send the magic to allow us to read the data
log(re, er)
os.sleep(0.1)
x = ble.sockreadhnd(sock,0x35) or ''
a = x:byte(1)
b = x:byte(2)
c = x:byte(3)
d = x:byte(4)
e = x:byte(5)
f = x:byte(6)
g = x:byte(7)
h = x:byte(8)
log(x,a,b,c,d,e,f,g,h)
end