Control Yandex Smart Home Devices
Python CLI controlling Yandex Smart Home lights and sockets from OpenClaw - power, brightness, color temperature, HSV color.
Why it matters
Automate your Yandex smart home by controlling devices and triggering scenarios through the Yandex IoT API. This asset enables seamless integration for managing your connected home environment.
Outcomes
What it gets done
Control smart home devices via Yandex IoT API
Manage device states and settings
Trigger custom smart home scenarios
Automate home routines and actions
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/yandex-iot | bash Overview
Yandex IoT Smart Home
A Python CLI for OpenClaw controlling Yandex Smart Home lights and sockets, with commands for power, brightness, color temperature, and HSV color. Use when OpenClaw needs to list or control Yandex Smart Home lights, LED strips, garlands, or smart sockets.
What it does
This is a Python CLI for controlling Yandex Smart Home devices from the OpenClaw AI assistant - lamps, chandeliers, smart sockets, and garlands. It can turn devices on/off, adjust brightness (0-100), adjust color temperature (1500-6500K), and set color via HSV (Hue, Saturation, Value), with JSON output for easy integration.
When to use - and when NOT to
Use it when OpenClaw needs to list, query, or control Yandex Smart Home devices - lights, chandeliers, LED strips, garlands, or smart sockets - by turning them on/off or adjusting brightness, color temperature, or HSV color. It requires Python 3.8+ and a Yandex OAuth token; full OpenClaw integration details live in a separate SKILL.md.
Inputs and outputs
Setup:
git clone https://github.com/wannawhat/openclaw-yandexiot.git
cd openclaw-yandexiot
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Getting an OAuth token: create an app at Yandex's OAuth console (selecting "for API access or debugging"), copy the resulting client_id, visit https://oauth.yandex.ru/authorize?response_type=token&client_id=<your_client_id> to authorize, copy the token shown on the resulting page, and save it to a .env file as ya_oauth_token. python3 main.py get_all returns JSON listing every device with its id, name, room, type, current state, and supported capabilities - for example a ceiling light entry shows "type": "light.ceiling", "room": "Bedroom", state {"on": true, "brightness": 100, "temp": 4500}, and "can": ["on_off", "brightness", "temp", "color"]. Device control commands: python3 main.py on/off <device_id>, python3 main.py set <device_id> brightness <0-100>, python3 main.py set <device_id> temp <1500-6500> (1500=warm, 6500=cold), and python3 main.py set <device_id> color <H> <S> <V> (Hue 0-360, Saturation 0-100, Value 0-100).
Integrations
Five device types are recognized: light (lamp or smart socket with a lamp), light.ceiling (chandelier), light.strip (LED strip), light.garland (garland), and socket (smart socket). Every command returns JSON - {"status": "ok"} (optionally with a result array) on success, or {"status": "error", "message": "..."} on failure. Example scenarios given: an evening warm/soft light preset (brightness 30, temp 2700), a bright/cold work-mode preset (brightness 100, temp 5000), and colored lighting presets (purple 270/96/100, red 0/100/100, blue 240/100/100). Created by wannawhat for integration with OpenClaw, and integrated and maintained by Ray. Licensed under MIT.
Who it's for
OpenClaw users and integrators who want to control Yandex Smart Home lighting and sockets - listing devices, toggling power, and adjusting brightness, color temperature, or HSV color - from a scriptable CLI with JSON output, without building the Yandex Smart Home API integration themselves.
Source README
Yandex Smart Home CLI for OpenClaw
Python CLI for managing Yandex Smart Home devices from the OpenClaw AI assistant.
Features
- Control lamps, chandeliers, smart plugs, and garlands
- Turn devices on/off
- Adjust brightness (0-100)
- Adjust color temperature (1500-6500K)
- Set color via HSV (Hue, Saturation, Value)
- JSON output for easy integration
Requirements
- Python 3.8+
- Yandex OAuth token
Installation
git clone https://github.com/wannawhat/openclaw-yandexiot.git
cd openclaw-yandexiot
python3 -m venv venv
source venv/bin/activate # or venv/bin/activate on Windows
pip install -r requirements.txt
Getting an OAuth Token
- Create an application: https://oauth.yandex.ru/?dialog=create-client-entry (select "For API access or debugging")
- Copy your
client_id - Go to the authorization link:
https://oauth.yandex.ru/authorize?response_type=token&client_id=YOUR_CLIENT_ID - Copy the token from the page
- Create a
.envfile:ya_oauth_token=YOUR_TOKEN
Usage
Get list of devices
python3 main.py get_all
Returns JSON with information about all devices:
[
{
"id": "1b82d50d-8662-44c2-a6ac-b53b8b5481f4",
"name": "Ceiling Light",
"room": "Bedroom",
"type": "light.ceiling",
"state": {
"on": true,
"brightness": 100,
"temp": 4500
},
"can": ["on_off", "brightness", "temp", "color"]
}
]
Turn on/off
python3 main.py on <device_id>
python3 main.py off <device_id>
Set brightness
python3 main.py set <device_id> brightness 80
Value: 0-100
Set color temperature
python3 main.py set <device_id> temp 4000
Value: 1500 (warm) - 6500 (cool)
Set color
python3 main.py set <device_id> color 270 96 100
HSV parameters:
- H (Hue): 0-360 (red=0, blue=240, green=120)
- S (Saturation): 0-100
- V (Value/Brightness): 0-100
Integration with OpenClaw
Full integration documentation is available in SKILL.md.
Scenario Examples
Evening lighting
# Warm soft light
python3 main.py set <device_id> brightness 30
python3 main.py set <device_id> temp 2700
Work mode
# Bright cool light
python3 main.py set <device_id> brightness 100
python3 main.py set <device_id> temp 5000
Color accent lighting
# Purple
python3 main.py set <device_id> color 270 96 100
# Red
python3 main.py set <device_id> color 0 100 100
# Blue
python3 main.py set <device_id> color 240 100 100
Device Types
| Type | Description |
|---|---|
light |
Lamp / smart plug with lamp |
light.ceiling |
Chandelier |
light.strip |
LED strip |
light.garland |
Garland |
socket |
Smart plug |
Output Format
All commands return JSON:
Success:
{"status": "ok"}
or
{
"status": "ok",
"result": [...]
}
Error:
{
"status": "error",
"message": "error description"
}
Author
Created by @wannawhat for integration with OpenClaw.
Integrated and maintained by Ray 🔦
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.