Skip to main content

Python API client for Tesla Connect Pakistan geyser and inverter devices

Project description

pyteslaconnectpk

PyPI License

Python API client for Tesla Connect Pakistan geyser and inverter devices.

Disclaimer: This is an unofficial, community-built library. The author has no affiliation with Tesla Industries Pakistan (https://tesla-pv.com). All product names, logos, and brands are property of their respective owners.

Installation

pip install pyteslaconnectpk

Quick Start

from pyteslaconnectpk import TeslaConnectApi

client = TeslaConnectApi("03XXXXXXXXX", "your_password")
client.sign_in()

print(f"Logged in as {client.user_name}")
print(f"Devices: {len(client.devices)}")

# Get geyser details
for device in client.devices:
    if device["type_id"] == 2:  # Geyser
        details = client.get_geyser_details(device["device_id"])
        print(f"Temperature: {details['curr_temp']}°C")

# Control the geyser
client.set_geyser_temp_limit("device_id", 55)
client.set_geyser_boost("device_id", True)

API Reference

Authentication

Method Description
sign_in() Authenticate and obtain a session token
change_password(new_password) Change the account password

Devices

Method Description
refresh_devices() Re-login to refresh the device list
add_device(device_id, name) Register a new device
delete_device(device_id, name) Remove a device

Geyser

Method Description
get_geyser_details(device_id) Get geyser status (temp, mode, timers, etc.)
set_geyser_boost(device_id, enabled) Toggle boost mode
set_geyser_mode(device_id, curr_mode, user_mode) Set operating mode
set_geyser_temp_limit(device_id, temp_limit) Set target temperature
set_geyser_timer(device_id, times) Set hourly schedule
set_geyser_two_hour_mode(device_id, enabled) Toggle two-hour mode
set_geyser_vacation_mode(device_id, enabled) Toggle vacation mode

Inverter

Method Description
get_inverter_details(device_id) Get inverter status

Constants

Constant Value Description
DEVICE_TYPE_GEYSER 2 Geyser device type
DEVICE_TYPE_INVERTER 1 Inverter device type
GEYSER_MODE_GAS 0 Gas mode
GEYSER_MODE_ELECTRICITY 1 Electric mode
GEYSER_MODE_AUTOMATIC 2 Automatic mode
GEYSER_MODE_SOLAR_ENABLED 3 Solar enabled
GEYSER_MODE_SOLAR_DISABLED 4 Solar disabled

Exceptions

Exception When
TeslaConnectAuthError Invalid credentials or expired session
TeslaConnectApiError Connection failure, timeout, or HTTP error

Used By

License

MIT

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

pyteslaconnectpk-1.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

pyteslaconnectpk-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pyteslaconnectpk-1.0.0.tar.gz.

File metadata

  • Download URL: pyteslaconnectpk-1.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pyteslaconnectpk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ff9c5bb9300997f7b509184e0093d4c7bc1f718221555123388f4abc065b877a
MD5 505f0fd8c34e2b9ba99fca127fd4bf15
BLAKE2b-256 f010baf9464ec9f7cccb085c873d3a2cc560ee1c0d7eef700670bdcddaad2c55

See more details on using hashes here.

File details

Details for the file pyteslaconnectpk-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyteslaconnectpk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51645388d52cd554a33f1db83414ab1da9d3617f4e8b712d10ba733ad3eb05e5
MD5 d7647b8e34bc232b9364794b02413384
BLAKE2b-256 768719422826d2ef0710c264e91b5f51bd8678e22c71e45752111abb0bfb9480

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