-
Hi! First of all - great work on this extractor! Could you tell me how you discovered API URLs for your requests? I'm working on my own script to access data from BLE temperature and humidity sensors for HA integration. Those sensors appear on the device list but without additional data (although some devices do). I'm expecting something similar to I've found this website that seems to go into the right direction but I have no clue how to make use of it. Any help will be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
Hi! My work was based on two existing implementations: OpenHAB and valeCLOUDo, so I did't have to discover API URLs by myself. BLE URL was a change proposed by @rezmus in this issue. You can try to discover URLs by intercepting traffic from mobile app, e.g. using Wireshark. |
Beta Was this translation helpful? Give feedback.
-
@franeko you want to pull data from cloud for ble sensors (passed via ble gateways)? |
Beta Was this translation helpful? Give feedback.
-
it will pull last 10 records of prop.4100 (temperature) for did blt.X starting from time_end timestamp. humidity is prop.4102, but you can fetch any prop/event stored for ble device this way. limit to 1 and ts = now for last record. from my experience if you want to fetch more history data (loop with time_end = oldest record from last request - 1) use more frequent requests with lower limit rather than bigger limit (it makes their db unhappy). not sure how much time they keep such data, but afair was able to pull data sent 2y ago. |
Beta Was this translation helpful? Give feedback.
-
model: miaomiaoce.sensor_ht.t1 conditions: are you sure you have smart one and it's passing data to the cloud (you can see history in mijia app without active bt connection)? |
Beta Was this translation helpful? Give feedback.
-
no ble gw = no data, however there is some difference between ble devices using encrypted adv and these unencrypted. 1st can only work with gw on same region, because gw pulls ble key from the cloud to decrypt payload. 2nd may work with gw on many regions same time, because they don't need key to decrypt data. i don't remember if this sensor is encrypted or not, but if not it should also be able to upload data using gw on de region even if it's paired to cn region. miaomiaoce.sensor_ht.t1 looks unencrypted (short ble key). did you try to pull data from de api? |
Beta Was this translation helpful? Give feedback.
it will pull last 10 records of prop.4100 (temperature) for did blt.X starting from time_end timestamp. humidity is prop.4102, but you can fetch any prop/event stored for ble device this way. limit to 1 and ts = now for last record. from my experience if you want to fetch more history data (loop with time_end = oldest record from last request - 1) use more frequent requests with lower limit rather than bigger limit (it makes their db unhappy). not sure how much time they keep such data, but afair was able to pull data sent 2y ago.