Skip to main content

basic package to control sonoff switches

Project description

SonoffBasic

Itead Sonoff is a smart wifi switch to control electronics power supply. SonoffBasic allows to control sonoff switch via the cloud, with a very basic features.

⚠️ Project was tested on sonoff basic only. Other devices will be tested and adjust in the future.

requirements

  • Sonoff switch must be connected to ewelink app SONOFF Basic USER GUIDE.
  • Username is email address.
  • Ewelink account region must be one of 'us', 'eu' or 'cn'.

How to use ✨

  • Create an instance of Sonoff with ewelink. available params (all values in string format):

    • username - email address (required)
    • password (required)
    • region (optional) default 'us'
    • timezone (optional) default 'US/Pacific'
    >>> from SonoffBasic import sonoff
    >>> sonoff = sonoff.Sonoff(username='my_name@example.com',
                        password='my_pass',
                        timezone='US/Pacific',
                        region='us')
    
  • Search the required device

    >>> print(sonoff.devices)
    [{'name': 'taco', 'deviceid': '1000157898', 'status': 'on'}, 
    {'name': 'Irrigation', 'deviceid': '100015b23r', 'status': 'off'}]
    
  • Control the device

    >>> sonoff.change_device_status(statusid = '1000157898',
                                    new_status = 'off')            
    deviceid: 1000157898 status successfully changed to off
    

Special Thanks

Thanks to @AlexxIT. cloud connection to eWeLink was inspired by SonoffLAN project.

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

SonoffBasic-0.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distributions

SonoffBasic-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

SonoffBasic-0.0.1-py2.py3-none-any.whl (4.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file SonoffBasic-0.0.1.tar.gz.

File metadata

  • Download URL: SonoffBasic-0.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for SonoffBasic-0.0.1.tar.gz
Algorithm Hash digest
SHA256 314a63fd7666b3f3348d9f5ee34003449b5019c1bdbc3bdee0388c3aee0a8669
MD5 a77ac7f1d24b5b54b7f971ae21355836
BLAKE2b-256 d2c05126c9654f1b7cbac3ef567700444f1bfadb226e1fbf3b51b83f34867029

See more details on using hashes here.

File details

Details for the file SonoffBasic-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: SonoffBasic-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for SonoffBasic-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6607141423d995adfcda004ebcb0a4f54fbc59e665ce02156011003d16390772
MD5 2f0cb63acfcec6aede077cbc564a7c49
BLAKE2b-256 904c3de15c530e6cd2795c40c298478f7d700c12a942ad84be0094441bd8b333

See more details on using hashes here.

File details

Details for the file SonoffBasic-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: SonoffBasic-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for SonoffBasic-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 489e83f7f7ff9fc64c7f5b41d1f795dda8218f9fc32687ed1b138866edc1b579
MD5 c23c66d6ac7ed494c2727d3dfca19095
BLAKE2b-256 aa215f0109d17249552b9ebf4328ecf7b78be261e7e4569f5f891e2ad1fe01a5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page