# 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](https://www.shelly.com/en/products/shop)<br>
Request Feature/Suggestion: https://forms.gle/efGD5DuTpWsX96GG7
# Download stats
[](https://pepy.tech/project/shelly-control)
## Installation
```console
pip install shelly_control
```
Shelly supports Python 3+.
## Usage
#### Default
```python
import shelly_control
```
#### Authentication
Before making requests, you need to authenticate using your Shelly API key. Initialize the `Connect` class with your API key:
```python
from shelly_control import Connect
base_url = "Your Cloud Server Address"
api_key = "Your Authorization cloud key"
sh = Connect(base_url,api_key)
```
OR
```python
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](https://control.shelly.cloud/#/settings/user)
### Relay
#### Fetch Devices
```python
# Fetch device status
sh.get_device('device_id')
```
#### Control Devices
```python
# Control device
sh.control_device(channel , 'on'/'off' , device_id)
```
#### Bulk Control Devices
```python
# 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
```python
# Control Roller
sh.control_roller_direction(direction , device_id)
```
#### Control Roller Position
```python
# Control Roller
sh.control_roller_position(position , device_id)
```
#### Bulk Control Roller
```python
# Bulk Control Roller
sh.bulk_control_rollers(device_id)
```
### Lights
#### Control Lights
```python
# Bulk Control Roller
sh.control_light(turn=None , white=None , red=None , green=None , blue=None , gain=None , device_id=None)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "shelly-control",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "Shelly, Shelly plug, Shelly cloud api, shelly cloud, Shelly access control, Shelly python library",
"author": null,
"author_email": "Ankush Kumar <ankush1611996@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/ca/e7/b14d6ecf11d0ee1aa019506fa106eae171e71cbe904d5dc6f0a02ade1653/shelly_control-0.3.tar.gz",
"platform": null,
"description": "# Shelly Easy Smart Home Automation\n\n\nSHELLY: The go-to access control for smart homes.\n\nThis Python library provides convenient access to the Shelly cloud API, allowing you to manage your relays, rollers and lights.\n\n\n[Shelly Shop](https://www.shelly.com/en/products/shop)<br>\nRequest Feature/Suggestion: https://forms.gle/efGD5DuTpWsX96GG7\n\n# Download stats\n\n[](https://pepy.tech/project/shelly-control)\n\n## Installation\n```console\npip install shelly_control\n```\nShelly supports Python 3+.\n\n## Usage\n#### Default\n```python\nimport shelly_control\n```\n\n#### Authentication\n\nBefore making requests, you need to authenticate using your Shelly API key. Initialize the `Connect` class with your API key:\n\n```python\nfrom shelly_control import Connect\n\nbase_url = \"Your Cloud Server Address\"\napi_key = \"Your Authorization cloud key\"\nsh = Connect(base_url,api_key)\n```\nOR\n```python\nimport shelly_control \n\nbase_url = \"Your Cloud Server Address\"\napi_key = \"Your Authorization cloud key\"\nsh = shelly_control.Connect(base_url,api_key)\n```\nGet Key & Server address from here [Shelly Control Cloud Dashboard](https://control.shelly.cloud/#/settings/user)\n\n### Relay\n#### Fetch Devices\n```python\n# Fetch device status\nsh.get_device('device_id')\n\n```\n\n#### Control Devices\n```python\n# Control device\nsh.control_device(channel , 'on'/'off' , device_id)\n\n```\n#### Bulk Control Devices\n```python\n# Bulk Control device\nsh.bulk_control_relays('devices')\n\n# Parameters:\n# - devices (list of dict): List of devices to control, each device should be a dictionary with keys:\n# - \"id\" (int): ID of the device.\n# - \"channel\" (int): Index of the relay or switch component.\n```\n\n### Rollers\n#### Control Roller Direction\n```python\n# Control Roller\nsh.control_roller_direction(direction , device_id)\n\n```\n\n#### Control Roller Position\n```python\n# Control Roller\nsh.control_roller_position(position , device_id)\n\n```\n\n#### Bulk Control Roller\n```python\n# Bulk Control Roller\nsh.bulk_control_rollers(device_id)\n\n```\n\n### Lights\n#### Control Lights\n```python\n# Bulk Control Roller\nsh.control_light(turn=None , white=None , red=None , green=None , blue=None , gain=None , device_id=None)\n\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A python package for Shelly Cloud API. Shelly is devoted to the development of innovative IoT solutions and products.",
"version": "0.3",
"project_urls": {
"Bug Tracker": "https://github.com/AnkushRozra/shelly/issues",
"Homepage": "https://github.com/AnkushRozra/shelly"
},
"split_keywords": [
"shelly",
" shelly plug",
" shelly cloud api",
" shelly cloud",
" shelly access control",
" shelly python library"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6948569c0d90bca2d49b40c6f466fe86bfb3405ae8b05cb7d765031126f60a7",
"md5": "dd5a877f1b46312405e1df337844a4eb",
"sha256": "b767cabf3d79351808512858493a3a77df892c81a759c6a240fda8979d86f3a3"
},
"downloads": -1,
"filename": "shelly_control-0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd5a877f1b46312405e1df337844a4eb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5986,
"upload_time": "2025-01-08T17:53:17",
"upload_time_iso_8601": "2025-01-08T17:53:17.573765Z",
"url": "https://files.pythonhosted.org/packages/e6/94/8569c0d90bca2d49b40c6f466fe86bfb3405ae8b05cb7d765031126f60a7/shelly_control-0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cae7b14d6ecf11d0ee1aa019506fa106eae171e71cbe904d5dc6f0a02ade1653",
"md5": "2e41daf7d99e15f1826c54eca4021cae",
"sha256": "1baf1193c9dea00233745f8fd0dc354db5289a18f9c0504440dbbec762332d5e"
},
"downloads": -1,
"filename": "shelly_control-0.3.tar.gz",
"has_sig": false,
"md5_digest": "2e41daf7d99e15f1826c54eca4021cae",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5945,
"upload_time": "2025-01-08T17:53:19",
"upload_time_iso_8601": "2025-01-08T17:53:19.750689Z",
"url": "https://files.pythonhosted.org/packages/ca/e7/b14d6ecf11d0ee1aa019506fa106eae171e71cbe904d5dc6f0a02ade1653/shelly_control-0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-08 17:53:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AnkushRozra",
"github_project": "shelly",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "shelly-control"
}