Skip to main content

basic package to control sonoff switches

Project description

SonoffBasic

SonoffBasic allows to control Sonoff switches via the Ewelink cloud, with a very basic features.

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

requirements

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.sonoff import 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', 'outletid': 0, 'status': 'on'}, 
    {'name': 'Irrigation', 'deviceid': '100015b23r', 'outletid': 0, 'status': 'off'}]
    
  • Control the device

    >>> sonoff.change_device_status(deviceid = '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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

Uploaded Python 3

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: SonoffBasic-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for SonoffBasic-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a2205a9e41f4c5eecee41b3d33dfc75db4cf41c2e59501b0a1a8cfd305af6bcc
MD5 7445d5fb2a862b5e0dd6050d08d174ca
BLAKE2b-256 bdd5c3ade916c7d230d29fdd7acc7c254ffa59cb27c9e232fb214e4b1782f3aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: SonoffBasic-0.0.2-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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dd6ea6b44801eb4ee73a1641a66cdb1acef3d01cd48ee79a4322dba2dd9e574b
MD5 3bcad5e0e1a8323198cd4e41e08b6c9f
BLAKE2b-256 086984c1a4a16ff4f66e56f8c821f9513062f1993ea5e20f289a837927303fd8

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