Skip to main content

Package for TFA KlimaLoggPro-Driver to use with Home Assistant

Project description

kloggpro

This is a library to query "TFA KlimaLogg pro" weather stations via its included USB transceiver. It is used for an Integration into Home Assistant.

Acknowledgement

This is derived from the code of weex-klimalogg by matthewwall. Thanks alot to the authors of that project!

Status experimental!

kloggpro can be installed via PyPI on Raspberry Pi OS.

It needs usb access to work properly, maybe you need to grant usb access to the USB-Transceiver by

  • adding the user to plugdev group
    sudo adduser <username> plugdev
  • add following rule to /etc/udev/rules.d/50-usb-perms.rules:
    SUBSYSTEM=="usb", ATTRS{idVendor}=="6666", ATTRS{idProduct}=="5555", GROUP="plugdev", MODE="0660"

To check for success:

  lsusb 
  Bus 001 Device 004: ID 6666:5555 Prototype product Vendor ID 
  # should show the klimlogg receiver, here bus 001 device 004 
  ls -l /dev/bus/usb/001/004 
  # expected output would be 
  crw-rw-rw- 1 root plugdev 189, 3 Dec 21 21:52 /dev/bus/usb/001/004
  # now group plugdev can access the device and everything should work

(I had an error: The device has no langid (permission issue, no string descriptors supported or device error), so i followed these instructions)

Usage

After successful installation and usb configuration start python and
import kloggpro.klimalogg
Now you can create a KlimaLoggDriver-Object
kldr = KlimaLoggDriver()
To start communication, you need to clear wait state
kldr.clear_wait_at_start()

Now it is possible to either access the current values object directly
kldr._service.current.values['Temp0']
or you can receive packets:

for packet in kldr.genLoopPackets():
    print("Time: {} - {}".format(packet['dateTime'], packet))
    time.sleep(5)

After finishing:
kldr.shutDown()

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

kloggpro-0.0.2.tar.gz (26.7 kB view hashes)

Uploaded Source

Built Distribution

kloggpro-0.0.2-py3-none-any.whl (38.4 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