meross-api-server - v1.0.1
    Preparing search index...

    meross-api-server - v1.0.1

    Meross API Server

    GitHub GitHub package.json version TypeScript Documentation

    A TypeScript-powered Express API server for managing Meross smart devices via the Meross Cloud. Built for seamless IoT automation and smart control integration.

    ┌───────────────────────────────────────────────────────────────────────┐
    │                            Meross API Server                          │
    │                                                                       │
    │  ┌───────────────────┐    ┌───────────────────┐    ┌───────────────┐  │
    │  │    Express App    │    │  MerossManager    │    │  MerossCloud  │  │
    │  │                   │    │                   │    │    (SDK)      │  │
    │  │ - REST Endpoints  │◄──►│ - Device Mgmt     │◄──►│ - Cloud Comm  │  │
    │  │ - Middlewares     │    │ - Sync            │    │ - Auth        │  │
    │  └───────────────────┘    └───────────────────┘    └───────────────┘  │
    │                                                                       │
    └───────────────────────────────────────────────────────────────────────┘
    
    • 🔌 Connect to Meross Cloud service
    • 📋 List all available Meross devices
    • 🔄 Synchronize devices between local and cloud
    • 🔘 Toggle device channels (on/off)
    • 🚀 RESTful API endpoints for device management
    • 🔒 Secure authentication with Meross Cloud
    • 📝 Comprehensive TypeScript typings
    1. Clone the repository:
    git clone https://github.com/munirmardinli/meross-api-server.git
    cd meross-api-server
    1. Install dependencies
    npm install
    
    1. Create a .env file with your Meross credentials:
    MEROSS_EMAIL=your@email.com
    MEROSS_PASSWORD=yourpassword

    Running the Server

    npx tsx watch src/index.ts  # Development mode with hot-reload
    node dist/src/index.js # Production mode

    The server will start on port 3000 by default.

    GET /devices

    List all discovered Meross devices.

    Example Response:

    [
    {
    "uuid": "1234567890",
    "name": "Smart Plug",
    "type": "mss110",
    "online": true,
    "controllable": true
    }
    ]

    POST /devices/:uuid/toggle

    Toggle a device's channel state.

    Request Body:

    {
    "channel": 0
    }

    Success Response:

    {
    "status": "success",
    "device": "Smart Plug",
    "action": "toggle",
    "channel": 0
    }

    Error Response:

    {
    "error": "Device not controllable",
    "solution": "Check synchronization"
    }

    Building the Project

    npx tsc
    
    Environment Variable Required Description
    MEROSS_EMAIL Your Meross account email
    MEROSS_PASSWORD Your Meross account password
    PORT Server port (default: 3000)

    Contributions are welcome! Please open an issue or submit a pull request.

    1. Fork the project
    2. Create your feature branch (git checkout -b feature/AmazingFeature)
    3. Commit your changes (git commit -m 'Add some AmazingFeature')
    4. Push to the branch (git push origin feature/AmazingFeature)
    5. Open a Pull Request

    Distributed under the MIT License. See LICENSE for more information.

    Munir Mardinli

    📧 munir@mardinli.de

    🔗 GitHub Repository