Skip to main content

library to read from Sensorpush HW.t bluetooth sensor

Project description

pysensorpush-bleak

Python library which uses gatttool to read temperature data from a Sensorpush HT.w temperature sensor.

  1. Find the mac address of your sensor:
pi@raspberrypi:~ $ sudo hcitool lescan
LE Scan ...
A4:34:F1:7F:CD:D8 SensorPush HT.w CDD8
  1. Example usage:
pi@raspberrypi:~/p/pysensorpush-bleak/src/pysensorpush-bleak $ python
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sensorpush as sp
>>> import asyncio
>>> from bleak import BleakClient
>>> async def main():
...     client = BleakClient("A4:34:F1:7F:CD:D8")
...     await client.connect()
...     temp_c = await sp.read_temperature(client)
...     print("temperature = {}".format(temp_c))
...     client.disconnect()
...
>>> asyncio.run(main())
temperature = 13.92
>>>

pysensorpush_pic

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sensorpush-bleak-1.0.7.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

sensorpush_bleak-1.0.7-py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page