- Notifications
You must be signed in to change notification settings - Fork0
Simple OpenMetrics exporter for BLE devices
License
NotificationsYou must be signed in to change notification settings
rostrovsky/blexy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
SimpleOpenMetrics exporter for BLE devices.
- device with BLE compliant transceiver (e.g. RPi 3+)
- Python 3.7+
pip install blexyblexy --port 8888 --config-file ~/.blexy.yaml
/
- returns list of connected devices in JSON format./metrics
- returns values read from connected BLE devices inOpenMetrics format.
- Device & server configuration is by default expected to be placed in
./config.yaml
. - Custom config file path can be specified via
-c / --config-file
command line option. port
andlog_level
can be either specified in config file or through command line options (seeblexy -h
for exact option names).
Below file will make blexy connect to two Xiaomi temperature / humidity sensors and listen on port 8080:
port:8080log_level:infoble:devices: -name:living room sensormodel:LYWSD03MMCaddress:xx:xx:xx:xx:xx:xx -name:bedroom sensormodel:LYWSD03MMCaddress:xx:xx:xx:xx:xx:xx
$ curl localhost:8080/metrics# TYPE battery_level_percentage gauge# UNIT battery_level_percentage percentagebattery_level_percentage_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 77battery_level_percentage_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 88# TYPE humidity_percentage gauge# UNIT humidity_percentage percentagehumidity_percentage_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 48humidity_percentage_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 51# TYPE temperature_celsius gauge# UNIT temperature_celsius celsiustemperature_celsius_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 22.33temperature_celsius_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 25.11# TYPE voltage_volts gauge# UNIT voltage_volts voltsvoltage_volts_gauge{name="living room sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 3.11voltage_volts_gauge{name="bedroom sensor",model="LYWSD03MMC",manufacturer="Xiaomi",address="xx:xx:xx:xx:xx:xx",interface="0"} 3.03# EOF
LYWSD03MMC
(Xiaomi)
About
Simple OpenMetrics exporter for BLE devices
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.