A python package for Shelly Cloud API. Shelly is devoted to the development of innovative IoT solutions and products.
Project description
Shelly Easy Smart Home Automation
SHELLY: The go-to access control for smart homes.
This Python library provides convenient access to the Shelly cloud API, allowing you to manage your relays, rollers and lights.
Shelly Shop
Request Feature/Suggestion: https://forms.gle/efGD5DuTpWsX96GG7
Download stats
Installation
pip install shelly_control
Shelly supports Python 3+.
Usage
Default
import shelly_control
Authentication
Before making requests, you need to authenticate using your Shelly API key. Initialize the Connect
class with your API key:
from shelly_control import Connect
base_url = "Your Cloud Server Address"
api_key = "Your Authorization cloud key"
sh = Connect(base_url,api_key)
OR
import shelly_control
base_url = "Your Cloud Server Address"
api_key = "Your Authorization cloud key"
sh = shelly_control.Connect(base_url,api_key)
Get Key & Server address from here Shelly Control Cloud Dashboard
Relay
Fetch Devices
# Fetch device status
sh.get_device('device_id')
Control Devices
# Control device
sh.control_device(channel , 'on'/'off' , device_id)
Bulk Control Devices
# Bulk Control device
sh.bulk_control_relays('devices')
# Parameters:
# - devices (list of dict): List of devices to control, each device should be a dictionary with keys:
# - "id" (int): ID of the device.
# - "channel" (int): Index of the relay or switch component.
Rollers
Control Roller Direction
# Control Roller
sh.control_roller_direction(direction , device_id)
Control Roller Position
# Control Roller
sh.control_roller_position(position , device_id)
Bulk Control Roller
# Bulk Control Roller
sh.bulk_control_rollers(device_id)
Lights
Control Lights
# Bulk Control Roller
sh.control_light(turn=None , white=None , red=None , green=None , blue=None , gain=None , device_id=None)
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 shelly_control-0.2.tar.gz
.
File metadata
- Download URL: shelly_control-0.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 740bc983cfc74b45b1db85716b652673117abd6445c8b5893610f1e8ea084b90 |
|
MD5 | 813d8172bc89a588d530798eb65c3ef7 |
|
BLAKE2b-256 | f96d0ccf0416d8f2d996e419e68a69937c4ce59e15ee509f81dfe87f19cf6ff8 |
File details
Details for the file shelly_control-0.2-py3-none-any.whl
.
File metadata
- Download URL: shelly_control-0.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d168ede3471e5ab6913f57a0b0edbb75ccd6e9944347186be27c04094350f90 |
|
MD5 | 76fc1967a6297f5a5bc79ef963e461a1 |
|
BLAKE2b-256 | 79992017a77c284ec73e5fc47d6e27fded233a290a40266804d8529649876d83 |