Skip to main content

Python SDK for SenseID smart sensor tags — parse RAIN RFID, BLE and NFC sensor data, and control supported readers

Project description

senseid

PyPI - Version PyPI - Python Version

Python SDK for SenseID smart sensor tags. Parse sensor data from RAIN RFID, BLE, and NFC tags, and control supported reader devices through a unified interface.

Features

  • Multi-technology parsing: Decode SenseID sensor data from RAIN (UHF RFID), BLE beacons, and NFC tags
  • Unified reader interface: Control different RFID/NFC readers through a single API
  • Auto-discovery: Scan for supported readers via serial port, mDNS, and PC/SC
  • YAML-driven definitions: Tag types and sensor calibration defined in YAML files
  • Sensor data extraction: Temperature, humidity, and other magnitudes with automatic calibration

Supported Readers

Reader Driver Interface
Impinj R700 IMPINJ_IOT REST API (IoT Device Interface)
Impinj Speedway R420/R220/R120 OCTANE / SPEEDWAY Octane SDK / LLRP
NordicID Sampoo / Stix NURAPI / NURAPY NUR API
Phychips RED4S REDRCP RedRCP (serial)
ACS ACR1552 ACR1552 PC/SC (NFC)
Kliskatek BLE Reader KLSBLELCR BLE

Installation

pip install senseid

Quick Start

Parse a RAIN RFID tag

from senseid.parsers.rain import SenseidRainTag

tag = SenseidRainTag('000000F1D301010000012301')
print(tag.name)          # Tag model name
print(tag.sn)            # Serial number
for d in tag.data:
    print(f"{d.magnitude}: {d.value} {d.unit_short}")

Scan for readers and run inventory

from senseid.parsers import SenseidTag
from senseid.readers import SupportedSenseidReader, create_SenseidReader
from senseid.readers.scanner import SenseidReaderScanner

scanner = SenseidReaderScanner(autostart=True)
connection_info = scanner.wait_for_reader_of_type(SupportedSenseidReader.IMPINJ_IOT, timeout_s=10)
scanner.stop()

if connection_info is None:
    print('No reader found')
    exit()

reader = create_SenseidReader(connection_info)
reader.connect(connection_info.connection_string)

def on_tag(tag: SenseidTag):
    print(f"{tag.name} | SN: {tag.sn} | {tag.data}")

reader.start_inventory_async(notification_callback=on_tag)
input("Press Enter to stop...")
reader.stop_inventory_async()
reader.disconnect()

API Reference

Parsers

SenseidRainTag(epc: str | bytearray)

Parses a RAIN RFID EPC into a SenseidTag with decoded sensor data. Accepts hex string or bytearray.

SenseidBleTag(beacon: str | bytearray)

Parses a BLE advertisement payload into a SenseidTag.

parse_nfc_ndef(ndef_data: bytearray, uid: str) -> (SenseidTag, type_id)

Parses NFC NDEF data into a SenseidTag.

SenseidTag

Field Type Description
technology SenseidTechnologies RAIN, BLE, or NFC
id str Tag identifier (EPC hex, BLE MAC, NFC UID)
name str Tag model name
description str Tag description
sn int Serial number
fw_version int Firmware version
data list[SenseidData] Parsed sensor measurements
timestamp datetime Read timestamp

SenseidData

Field Type Description
magnitude str Measurement name (e.g. "Temperature")
magnitude_short str Short name (e.g. "Temp")
unit_long str Unit name (e.g. "Celsius")
unit_short str Unit symbol (e.g. "C")
value float Calibrated value

Readers

SenseidReaderScanner

Method Description
start() Start scanning for readers (serial, mDNS, PC/SC)
stop() Stop scanning
get_readers() Get list of discovered readers
wait_for_reader_of_type(type, timeout_s) Block until a reader of the given type is found

SenseidReader

Method Description
connect(connection_string) Connect to reader
disconnect() Disconnect
get_details() Get model, region, firmware, antenna count, power limits
get_tx_power() / set_tx_power(dbm) Get/set TX power in dBm
get_antenna_config() / set_antenna_config(list[bool]) Get/set active antennas
start_inventory_async(callback) Start inventory with tag notification callback
stop_inventory_async() Stop inventory

License

senseid is distributed under the terms of the MIT license.

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

senseid-1.2.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

senseid-1.2.0-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file senseid-1.2.0.tar.gz.

File metadata

  • Download URL: senseid-1.2.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for senseid-1.2.0.tar.gz
Algorithm Hash digest
SHA256 73aa09ba792f243b3babd168e3c3e6e2cc2f68a11767614b1ab12154de5a5b43
MD5 22ed7e004ebda7e3bf81f00770569756
BLAKE2b-256 33526a47ca1c3f26446cce8cd6961e8f29dfa88174418a360284222e353e602a

See more details on using hashes here.

File details

Details for the file senseid-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: senseid-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for senseid-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0eee2745be031c89af5f9f79feb5a5ef4e06538a940816f16a5142c999601b9
MD5 9cfab7ea2fb9e340d44a79809641d5ba
BLAKE2b-256 0b863530b27bcc6a23b349e232cb91b2eb8d5e1666bd5e99d4dcbaf645141119

See more details on using hashes here.

Supported by

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