Metadata-Version: 2.4
Name: temperature-sensor-scanner
Version: 1.0.0
Summary: A tool to collect data from temperature sensors and emit it into InfluxDB
Project-URL: Homepage, https://github.com/gene1wood/temperature-sensor-scanner
Project-URL: Repository, https://github.com/gene1wood/temperature-sensor-scanner
Author-email: Gene Wood <gene_wood@cementhorizon.com>
License: GPL-3.0-or-later
Requires-Python: >=3.10
Requires-Dist: atc-mi-interface
Requires-Dist: bleak
Requires-Dist: influxdb-client
Requires-Dist: platformdirs
Requires-Dist: pyyaml
Description-Content-Type: text/markdown

# temperature-sensor-scanner

A tool to scan nearby Bluetooth Low Energy thermometers on the Telink chipset, collect the data ane emit it into
InfluxDB.

## Setup

* Create an influxdb user with a command like `influx user create --org [my-org] --name [my-username] --password [my-password]`
* Create an influxdb token with a command like `influx auth create --org [my-org] --user [my-username] --write-bucket [my-bucket-id]`
* Create a `config.yaml` in `~/.config/temperature-sensor-scanner/` based on the `config.example.yaml` file
* Install this tool with a command like `pip install temperature-sensor-scanner`

## Usage

Run `temperature-sensor-scanner` which will scan for nearby sensors which are emitting temperature data in their Bluetooth
advertising string, collect that data, and emit it into InfluxDB.

# Notes

* https://github.com/pvvx/ATC_MiThermometer/
* https://pvvx.github.io/ATC_MiThermometer/TelinkMiFlasher.html
  * Launch in Chrome instead of Firefox
* Other tools that look interesting
  * https://github.com/JsBergbau/MiTemperature2

## Steps to provision a new sensor

* [Flash the firmware](https://github.com/pvvx/ATC_MiThermometer/?tab=readme-ov-file#flashing-or-updating-the-firmware-ota)
  * Click `Connect`
  * Select the `LYWSD03MMC` Bluetooth device in the menu
  * Click `Do Activation`
  * Choose `Custom Firmware ATC_v56.bin`
  * Click `Start Flashing`
  * Wait 42 seconds for it to show update done
* Identify ID from Bluetooth announced name and print a label to put on the sensor
* Quit Chrome and start again
* [Configure sensor](https://github.com/pvvx/ATC_MiThermometer/?tab=readme-ov-file#configuration)
  * Set display to Farenheight
  * Click `Set Time`
  * Set advertising type to `ATC1441`
  * Set advertising interval to `10000` ( https://github.com/pvvx/ATC_MiThermometer/issues/23#issuecomment-766898945 )
  * Set Measure interval: to 10
  * Click `Send Config`
