Skip to main content

LaCrosse sensor library

Project description

BuildStatus PyPiVersion Python versions Coveralls Maintainability

Requirements

This libray works with the Jeelink USB RF adapter and the arduino sketch hosted on the FHEM website.

Tested Devices

  • Technoline TX 29IT

  • Technoline TX 29DTH-IT

Command Line Tool

# pylacrosse -h
usage: LaCrosse sensor CLI tool. [-h] [-v] [-d DEVICE] [-f FREQUENCY_RFM1]
                                 [-F FREQUENCY_RFM2] [-t TOGGLE_INTERVAL_RFM1]
                                 [-T TOGGLE_INTERVAL_RFM2]
                                 [-m TOGGLE_MASK_RFM1] [-M TOGGLE_MASK_RFM2]
                                 [-r DATARATE_RFM1] [-R DATARATE_RFM2]
                                 {scan,info,led} ...

optional arguments:
  -h, --help            show this help message and exit
  -v                    be more verbose
  -d DEVICE, --device DEVICE
                        set local device e.g. '/dev/ttyUSB0' or
                        set remote device e.g. 'rfc2217://[IP]:[PORT]'
                        default: '/dev/ttyUSB0'
  -f FREQUENCY_RFM1     set the frequency for RFM1
  -F FREQUENCY_RFM2     set the frequency for RFM2
  -t TOGGLE_INTERVAL_RFM1
                        set the toggle interval for RFM1
  -T TOGGLE_INTERVAL_RFM2
                        set the toggle interval for RFM2
  -m TOGGLE_MASK_RFM1   set the toggle mask for RFM1
  -M TOGGLE_MASK_RFM2   set the toggle mask for RFM2
  -r DATARATE_RFM1      set the datarate for RFM1
  -R DATARATE_RFM2      set the datarate for RFM2

Commands:
  {scan,info,led}
    scan                Show all received sensors
    info                Get configuration info
    led                 Set traffic LED state

The LaCrosse sensor generates the ID every time the battery is changed.

Use the cli tool pylacrosse to find your device:

# pylacrosse -d /dev/ttyUSB0 scan
id=40 t=16.000000 h=69 nbat=0 name=unknown
id=16 t=18.700000 h=60 nbat=0 name=unknown
id=0 t=17.400000 h=65 nbat=0 name=unknown

You can generate a file with know devices at ~/.lacrosse/known_devices.ini

[0]
name = Kitchen
[16]
name = Livingroom
[40]
name = Bedroom

then the tool will print the defined names

# pylacrosse -d /dev/ttyUSB0 scan
id=40 t=16.000000 h=69 nbat=0 name=Bedroom
id=16 t=18.700000 h=60 nbat=0 name=Livingroom
id=0 t=17.400000 h=65 nbat=0 name=Kitchen

Using remote serial port with ser2net

You can also use ser2net to connect to a remote JeeLink Adapter. This can be useful, if you use a docker container or if you can not attach a JeeLink adapter to your host running pylacrosse. On your remote device install ser2net and add the following line to your ser2net.conf:

20001:telnet:0:/dev/ttyUSB0:57600 remctl banner

Restart the ser2net daemon and connect to your remote host using pylacrosse command line tool:

# pylacrosse -d rfc2217://[REMOTE_IP]]:20001 scan
id=40 t=16.000000 h=69 nbat=0 name=Bedroom
id=16 t=18.700000 h=60 nbat=0 name=Livingroom
id=0 t=17.400000 h=65 nbat=0 name=Kitchen

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

pylacrosse-0.4.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file pylacrosse-0.4.tar.gz.

File metadata

  • Download URL: pylacrosse-0.4.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/2.7.15

File hashes

Hashes for pylacrosse-0.4.tar.gz
Algorithm Hash digest
SHA256 de1fb8dd99eaf32265e68be36341c8578214f3171ead3afd8c39333f0ba01030
MD5 9b377cee1b12b797676822b60d1c8970
BLAKE2b-256 44e20371d5d1a6e0bf32c83b6df8ca08793b9ad22a28199e23c3e33f995fc5a9

See more details on using hashes here.

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