Skip to main content

Beginner friendly smart house API

Project description

BlacksnowAPI

Beginner-friendly Python library to control a smart house using the Black Snow API.

BlacksnowAPI v1.0.0 introduces a clean, class-based interface for controlling:

  • Lights
  • Fan
  • Alarm
  • Door
  • Blinds
  • Thermostat

Installation

pip install blacksnowapi

Quick Start

from blacksnowapi import SmartHouseAPI

house = SmartHouseAPI("YOUR_HOUSE_ID")

house.light_on("living")
house.fan_on("bedroom")
house.set_thermostat("cooling", 72)

Setup

Create an instance of SmartHouseAPI using your house ID:

from blacksnowapi import SmartHouseAPI

house = SmartHouseAPI("YOUR_HOUSE_ID")
  • YOUR_HOUSE_ID: The unique 5-letter ID assigned to your smart house. You can obtain it from Black Snow Smart House Labs.
  • Required before calling any method.

Features

Lights

Turn On Lights

house.light_on("living")

Turn Off Lights

house.light_off("bedroom")

Toggle Lights

house.toggle_light("kitchen")
  • room: One of the following strings: "living", "bedroom", "kitchen", "office", "outdoor"

Fan

Turn Fan On

house.fan_on("living")

Turn Fan Off

house.fan_off("bedroom")
  • room: Same as lights: "living", "bedroom", "kitchen", "office", "outdoor"
  • Value: True = on, False = off

Alarm

Turn Alarm On

house.alarm_on()

Turn Alarm Off

house.alarm_off()
  • Value: True = on, False = off

Door

Open Door

house.open_door()

Close Door

house.close_door()

Toggle Door

house.toggle_door()
  • Value: True = open, False = closed

Blinds

Set Blinds Percentage

house.set_blinds("living", 50)
house.set_blinds("bedroom", 0)
house.set_blinds("kitchen", 100)
  • room: "living", "bedroom", "kitchen"
  • percentage: Integer between 0–100 (0 = fully open, 100 = fully closed)

Fully Open Blinds

house.blinds_open("living")

Fully Close Blinds

house.blinds_close("bedroom")

Thermostat

Set Thermostat

house.set_thermostat("heating", 72)
house.set_thermostat("cooling", 70)
house.set_thermostat("off", 65)
  • mode: "heating", "cooling", "off"
  • target: Number between 60–85

Utility

Wait

house.wait(5)

Pauses execution for a number of seconds.

Full Example

from blacksnowapi import SmartHouseAPI

house = SmartHouseAPI("ABCDE")

# Lights
house.light_on("living")
house.light_off("bedroom")
house.toggle_light("kitchen")

# Fan
house.fan_on("living")
house.fan_off("bedroom")

# Alarm
house.alarm_on()
house.alarm_off()

# Door
house.open_door()
house.close_door()
house.toggle_door()

# Blinds
house.set_blinds("living", 50)
house.blinds_open("bedroom")
house.blinds_close("kitchen")

# Thermostat
house.set_thermostat("heating", 72)
house.set_thermostat("cooling", 70)
house.set_thermostat("off", 65)

Notes

  • A valid house_id is required when creating SmartHouseAPI. You can obtain it from Black Snow Smart House Labs.
  • Room names must match your house configuration: "living", "bedroom", "kitchen", "office", "outdoor".
  • Blinds percentage must be between 0–100.
  • Thermostat temperature must be between 60–85.
  • Thermostat mode must be "heating", "cooling", or "off".
  • Lights, fan, alarm, and door values are boolean (True = on/open, False = off/closed).
  • Version 1.0.0 uses a class-based interface (older function-based versions are deprecated).

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

blacksnowapi-2.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

blacksnowapi-2.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file blacksnowapi-2.0.1.tar.gz.

File metadata

  • Download URL: blacksnowapi-2.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for blacksnowapi-2.0.1.tar.gz
Algorithm Hash digest
SHA256 be377345eb9e2fa5a23d45efcf44852af11a75a5e5132cdfae8e5f0373ffb844
MD5 052b00467121d9a8f18a7fd03d483078
BLAKE2b-256 65b0ee1433c36b66a97b2bda95d16593da3dee0b66ced10e6cfa248a3d91509f

See more details on using hashes here.

File details

Details for the file blacksnowapi-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: blacksnowapi-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for blacksnowapi-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b385bb8783d88edd71841f75ac3f94b5c9c0a283f276dc5e78d09083f26a68ef
MD5 cb4c0adafc110f6abf90bcaf0b8049a8
BLAKE2b-256 ad7b11dd5f6970e01272ab0353d3bbd800fb79e65ce9c11aeb5a74f13b77adde

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