Code Monkey home page Code Monkey logo

merossapi's Introduction

MerossApi

Welcome to MerossApi - your gateway to controlling Meross devices using a REST API built with Flask. This application seamlessly integrates the latest meross-iot library, providing you with the power to load and toggle your devices with multiple accounts simultaneously.

Features

  • Multi-Account Control: Effortlessly manage your Meross devices with multiple accounts concurrently.

  • Token-based Authentication: Security is paramount. This application ensures authentication through tokens, keeping your devices and data safe.

  • JSON Output: The application outputs data in JSON format, allowing you to implement a custom front-end for a personalized device management experience.

Note: This is my inaugural Python project, so your understanding and mercy are greatly appreciated! ๐Ÿ˜Š I have plans to release a front-end, possibly using Vue or React, along with ongoing improvements to the back-end.

Project Status: Work in progress. Expect exciting updates and enhancements in the future!

Installation

To get started with MerossApi, follow these steps:

  1. Install python:

    see Python Downloads for Windows https://www.python.org/downloads/windows

  2. Clone the Repository:

git clone https://github.com/your-username/MerossApi.git
cd MerossApi
  1. Install Dependencies:
pip install -r requirements.txt
  1. Running the Application Once you've completed the installation, running MerossApi is a breeze:
python main.py

This will start the Flask development server, and you'll be ready to interact with your Meross devices through the provided API.

Feel free to explore, contribute, and provide feedback! Together, we'll shape the future of MerossApi.

Feel free to customize this README further to suit your project's specific needs and style!

Routes usage examples

localhost:4449/auth:

Request type [POST] In the body add:

{
    "user": "[email protected]",
    "password": "YourPassword"
}

Return a token

{"token":"k782qW65U6sUyCqHACorMjAIcw-Xt9tAIxCr4VhkuLofmhy80lwfd"}

localhost:4449/loaddevices:

Request type [GET] In the body add filters:

[
    {"model":"mss710"},
    {"model":"mssXXX"}
]

In the headers add:

{"token":"k782qW65U6sUyCqHACorMjAIcw-Xt9tAIxCr4VhkuLofmhy80lwfd"}

Return a list of devices:

[
    {
        "deviceName": "Luci Platani",
        "deviceUid": "2006XXXXXXXX",
        "firmwareVersion": "3.1.6",
        "hardwareVersion": "3.0.0",
        "model": "mss710",
        "status": "ONLINE"
    },
    {
        "deviceName": "Luce Ufficio Dx",
        "deviceUid": "2006XXXXXXXX",
        "firmwareVersion": "3.1.6",
        "hardwareVersion": "3.0.0",
        "model": "mss710",
        "status": "ONLINE"
    },
    {
        "deviceName": "Luce Ufficio Sx",
        "deviceUid": "2006XXXXXXXX",
        "firmwareVersion": "3.1.6",
        "hardwareVersion": "3.0.0",
        "model": "mss710",
        "status": "ONLINE"
    }
]

localhost:4449/toggledevice

Request type [POST] In the body add filters:

[    
    {
        "deviceId": "2006XXXXXXXX",
        "enabled": false
    },
    {
        "deviceId": "22006XXXXXXXX",
        "enabled": true
    }
]

In the headers add:

   {"token":"k782qW65U6sUyCqHACorMjAIcw-Xt9tAIxCr4VhkuLofmhy80lwfd"}

Return a list of enabled device id:

[
    "2006XXXXXXXX",
    "2006XXXXXXXX"
]

localhost:4449/logout:

Request type [GET]

In the headers add:

   {"token":"k782qW65U6sUyCqHACorMjAIcw-Xt9tAIxCr4VhkuLofmhy80lwfd"}

merossapi's People

Contributors

ignotochi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cristilodor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.