Skip to main content

Client for retrieving data from the La Crosse View cloud

Project description

[!IMPORTANT] This project is no longer being updated. I no longer own a LaCrosse View device and I have moved on to other projects. I will only do general fixes required by Home Assistant. If you would like to to take over this repo and maintain it, please let me know.

La Crosse View

A library for retrieving data from La Crosse View-connected sensors.

Disclaimer

This library is NOT for the Jeelink LaCrosse sensors. You can find that library here. There is also a Home Assistant integration for the Jeelink LaCrosse sensors.

Installation

Run this in your terminal:

pip install lacrosse_view

Usage

This example shows how to get the latest data from every sensor connected to the first location on your account.

from lacrosse_view import LaCrosse
import asyncio
from datetime import datetime, timedelta
import time

async def get_data():
    api = LaCrosse()
    # Log in to your LaCrosse View account
    await api.login('username', 'password')
    # Get the sensors from the first location on the account
    locations = await api.get_locations()
    startTime = datetime.now() - timedelta(minutes=1)
    endTime = datetime.now()
    startTimeUnix = time.mktime(startTime.timetuple())
    endTimeUnix = time.mktime(endTime.timetuple())
    sensors = await api.get_sensors(locations[0], tz="America/Vancouver", start=startTimeUnix, end=endTimeUnix)
 
    for sensor in sensors:
        for field in sensor.sensor_field_names:
            # Each value is a dictionary with keys "s" and "u". "s" is the value and "u" is the Unix timestamp for it.
            value = sensor.data[field]["values"][-1]["s"]
            print(
                f"{sensor.name} {field}: {value}"
            )
    
    await api.logout()

asyncio.run(get_data())

Questions?

If you have any questions, please, don't hesitate to open an issue.

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

lacrosse_view-1.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

lacrosse_view-1.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file lacrosse_view-1.1.0.tar.gz.

File metadata

  • Download URL: lacrosse_view-1.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for lacrosse_view-1.1.0.tar.gz
Algorithm Hash digest
SHA256 66998f094802548d21d688aa32b7c4bf1c406a726c0bc476a09564e91ab49c9e
MD5 3e1879cb673923db781049fd9dfbb2fe
BLAKE2b-256 808126c0432237de8e57dcc512ff07090fa72859995aefe565aa9fffa9545fd0

See more details on using hashes here.

File details

Details for the file lacrosse_view-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: lacrosse_view-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for lacrosse_view-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e567b3cb9ea7f428917980aa4548bcad491969cf8fcdc87be45cd1936077920e
MD5 875afddc7003d7924631ddeaa5b6b8e6
BLAKE2b-256 975e971347b252a37c324d97e0e0d403d2b2bc0ef31603b90f32104e30b3730b

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