Skip to main content

LaCrosse sensor library for ha

Project description

BuildStatus PyPiVersion Python versions Coveralls Maintainability

Requirements

This library 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_ha -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_ha to find your device:

# pylacrosse_ha -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_ha/known_sensors.ini

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

then the tool will print the defined names

# pylacrosse_ha -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 file:

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

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

# pylacrosse_ha -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_ha-230a7.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

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

pylacrosse_ha-230a7-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file pylacrosse_ha-230a7.tar.gz.

File metadata

  • Download URL: pylacrosse_ha-230a7.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pylacrosse_ha-230a7.tar.gz
Algorithm Hash digest
SHA256 e16ba56e093abf307edb8b42ada3a0c124a1b7541bfa1182f30a52ada8379154
MD5 faa71d5439233a99c9082a29da08831f
BLAKE2b-256 2610c3f0e6b916ac08bca45572023b77e69c94a9b0ac78b5bb6b08023be522df

See more details on using hashes here.

File details

Details for the file pylacrosse_ha-230a7-py3-none-any.whl.

File metadata

  • Download URL: pylacrosse_ha-230a7-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for pylacrosse_ha-230a7-py3-none-any.whl
Algorithm Hash digest
SHA256 1e1c0916c5e3fa36f8c836a4937a28c8161bcf7a019937bccc6adc3f81c22650
MD5 093a71af6fe5181e5a62b29f5473eea1
BLAKE2b-256 1f3bccd42e22a3cdd1d01f855863e18ac5d0d68061b5e6d4f220d55c5ead2f03

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