Skip to main content

A simple library to deal with Meross devices. At the moment MSS110, MSS210, MSS310 smart plugs and the MSS425E power strip

Project description

Build status Deployment

Meross IoT library

A pure-python based library providing API for controlling Meross IoT devices over the internet.

To see what devices are currently supported, checkout the Currently supported devices section. Hopefully, more Meross hardware will be supported in the future.

This library is still work in progress, therefore use it with caution.

Installation

Due to the popularity of the library, I've decided to list it publicly on the Pipy index. So, the installation is as simple as typing the following command:

pip install meross_iot --upgrade

Usage

The following script demonstrates how to use this library.

import time
import sys
from meross_iot.api import MerossHttpClient

if __name__=='__main__':
    httpHandler = MerossHttpClient(email="YOUR_MEROSS_CLOUD_EMAIL", password="YOUR_PASSWORD")

    # Retrieves the list of supported devices
    print("Listing Devices...")
    devices = httpHandler.list_supported_devices()

    for counter, device in enumerate(devices):
        print("Playing with device: %d" % counter)
        # Returns most of the info about the power plug
        print("\nGetting system data...")
        data = device.get_sys_data()

        # Turns the power-plug on
        print("\nTurning the device on...")
        device.turn_off()

        # Turns the power-plug off
        print("\nTurning the device off...")
        device.turn_on()

        # Reads the historical device consumption
        print("\nReading consumption data...")
        consumption = device.get_power_consumptionX()

        # Returns the list of WIFI Network available for the plug
        # (Note. this takes some time to complete)
        print("\nScanning Wifi...")
        wifi_list = device.get_wifi_list()

        # Info about the device
        print("\nGetting device trace...")
        trace = device.get_trace()
        print("\nGetting device debug...")
        debug = device.get_debug()

        # Returns the capabilities of this device
        print("\nRetrieving device abilities...")
        abilities = device.get_abilities()

        # I still have to figure this out :S
        # The following command is not yet implemented on all devices
        # and might not work as expected.
        # report = device.get_report()

        # Returns the current power consumption and voltage from the plug
        # (Note: this is not really realtime, but close enough)
        print("\nReading electricity...")
        electricity = device.get_electricity()

Currently supported devices

Even though this library was firstly meant to drive only the Meross MSS310, other nice developers contributed to its realization. The following is the currently supported list of devices:

Protocol details

This library was implemented by reverse-engineering the network communications between the plug and the meross network. Anyone can do the same by simply installing a Man-In-The-Middle proxy and routing the ssl traffic of an Android emulator through the sniffer.

If you want to understand how the Meross protocol works, have a look at the Wiki. Be aware: this is still work in progress, so some pages of the wiki might still be blank/under construction.

Donate!

I like reverse engineering and protocol inspection, I think it keeps your mind trained and healthy. However, if you liked or appreciated by work, why don't you buy me a beer? It would really motivate me to continue working on this repository to improve documentation, code and extend the supported meross devices.

Buy me a beer

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meross_iot-0.1.4.2.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

meross_iot-0.1.4.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file meross_iot-0.1.4.2.tar.gz.

File metadata

  • Download URL: meross_iot-0.1.4.2.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for meross_iot-0.1.4.2.tar.gz
Algorithm Hash digest
SHA256 6ec6a4b75c30439d12f67d59846993d59642da136ef798ce8c9612ba7854ba3c
MD5 6e74cb13be03145845ed9c514870b8b2
BLAKE2b-256 6cc9543e83df24e9205619e341e27d57ff936ccad100234b482b1d6f189e7d7e

See more details on using hashes here.

File details

Details for the file meross_iot-0.1.4.2-py3-none-any.whl.

File metadata

  • Download URL: meross_iot-0.1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for meross_iot-0.1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e99423797a2d40e52453359f638f6797af63114be0431508a45f605e02e96c3
MD5 6f0e46c968d5a9409d57f3360b62066d
BLAKE2b-256 8b6bb2c5bdd967193e1fd35430feb580edc1345a79d53f08cc2f1c048cd06d41

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