No description
Find a file
2025-12-25 18:01:47 +01:00
examples introduce meter example, add meter information on update function 2022-11-16 13:13:34 +01:00
ShellyPy Add support for Shelly Gen3 and Gen4 -- same API as Gen2. 2025-12-25 18:01:47 +01:00
.gitignore Add support for gen 2 devices, separate generations into classes 2022-03-12 13:54:04 +01:00
LICENSE Initial Commit 2019-09-22 12:39:05 +02:00
MANIFEST.in add README to the manifest 2019-09-23 12:26:42 +02:00
README.md introduce meter example, add meter information on update function 2022-11-16 13:13:34 +01:00
requirements.txt Initial Commit 2019-09-22 12:39:05 +02:00
setup.py add author email 2019-09-23 12:28:14 +02:00
shellypy.spec add rpm spec 2020-11-02 19:49:33 +01:00

ShellyPy

not to be confused with pyShelly
Python 2 and 3 Wrapper around the Shelly HTTP api

why

other packages like pyShelly only support CoAP or MSQT, neither I am comfortable with using in personal projects

examples

relay

a simple working example for the Shelly 1 that turns a relay on

import ShellyPy

device = ShellyPy.Shelly("192.168.0.5")

device.relay(0, turn=True)

examples/toggle_relay.py

monitor

a simple working example for the Shelly 1 that request monitor information

import ShellyPy

device = ShellyPy.Shelly("192.168.68.121")

deviceMeter = device.meter(0)   #request meter information
print(deviceMeter['power'])     #print power information
print(deviceMeter['total'])     #print total information

other examples are available as well examples/meter.py

devices

supported

  • Shelly1
  • Shelly1PM
  • Shelly2
  • Shelly2.5
  • Shelly4Pro (untested)
  • Shelly Plug (untested)
  • Shelly PlugS (untested)
  • Shelly Bulb (untested)
  • Shelly H&T (untested)
  • Shelly Smoke (untested)
  • Shelly EM (untested)
  • Shelly flood (untested)

unsupported

  • Shelly Sense (documentation is inaccurate, incomplete)
  • Shelly RGBW (documentation is incomplete)

applicability

this wrapper is best used in closed networks where other solutions are either not an option or not desired
give your shelly devices static IP adresses for best results

license

this project is licensed under the MIT License
feel free to do whatever you want with it