Skip to main content

python-smarthab

This Python library allows you to programmatically control your SmartHab-powered home.

PyPI version

What is SmartHab?

SmartHab is a company that installs their home automation solution in new buildings, and offers a mobile application for home owners or renters to control their home over the Internet.

Mobile App → API → SmartHab box (1 at each floor) → Z-Wave devices

What does this library do?

python-smarthab connects to the SmartHab API and allows you to automate your home without having to use the mobile application.

It might prove particularly useful if integrated into a home automation box or software. Feel free to use it, it's under the GPL!

How do I use it?

pip3 install SmartHab
import pysmarthab

hub = pysmarthab.SmartHab()

# Login
await hub.async_login('smarthab.user@example.com', '1234567')

if not hub.is_logged_in:
    # Bad credentials :(
    raise SystemExit

# Get the list of available devices
devices = await hub.async_get_device_list()

# Close all roller shutters and turn on all lights
for device in devices:
    if isinstance(device, pysmarthab.Light):
        device.async_turn_on()

    if isinstance(device, pysmarthab.Shutter):
        device.async_close()

If you prefer to use it synchronously:

import pysmarthab

hub = pysmarthab.SmartHab()

# Login
hub.login('smarthab.user@example.com', '1234567')

if not hub.is_logged_in:
    # Bad credentials :(
    raise SystemExit

# Get the list of available devices
devices = hub.get_device_list()

# Close all roller shutters and turn on all lights
for device in devices:
    if isinstance(device, pysmarthab.Light):
        device.turn_on()

    if isinstance(device, pysmarthab.Shutter):
        device.close()

Release files for SmartHab 0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SmartHab 0.21
File Size Uploaded
SmartHab-0.21.tar.gz 7.2 kB Details

Release files / SmartHab-0.21.tar.gz

Download URL SmartHab-0.21.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf929455a2f7cc1e275b331de73d983587138a8d9179574988ba05fa152d3ccf
BLAKE2b-256 checksum
How to use checksums
bb764991f8e82015613fbb041f57fb1da481237dfa24f03c8f9e9519fceb7257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.5.9

Release history Release notifications | RSS feed

This release

0.21 This release

1 release file

0.20

1 release file

0.19

1 release file

0.18

1 release file

0.17

1 release file

0.16

1 release file

0.15

1 release file

0.14

1 release file

0.13

1 release file

0.12

1 release file

0.11

1 release file

0.10

1 release file

0.9

1 release file

0.8.1

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page