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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lacrosse_view-1.0.3.tar.gz
.
File metadata
- Download URL: lacrosse_view-1.0.3.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b47de9a0f9eb7cba5dc3ed014b22dd903bff4729fb717d8afb533b48ca7b5579 |
|
MD5 | 6ed2c305f04cc4d070b51395c253e333 |
|
BLAKE2b-256 | 8d7e133ceccdd16e039a810f67087ee6787c6facae4ccaa27a7ba8ce92c2f777 |
File details
Details for the file lacrosse_view-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: lacrosse_view-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6682535f3bef04034cce57895566b69183fbed5e0e57216cb6b9800b649ff944 |
|
MD5 | 946801e05ac7428a7852b2c595d6579f |
|
BLAKE2b-256 | 00b7fa52d7a1e25aeb92fad1fbcb2a626327e5851c3cb4b5b7a61c170a60c8c5 |