Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package
name: Publish Package to npmjs

on:
release:
types: [created]
workflow_dispatch:
types: [published]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: '20.x'
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
15 changes: 15 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Close stale issues'
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
days-before-stale: 30
days-before-close: 5
only: issues
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
bin/src/node_modules
cmd/
dumps/
old_certs/
# Directories
node_modules/
dist/

# Files
*.log
6 changes: 3 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Directories
certs/
cmd/
dumps/
mosquito/
old_certs/
teardown/

#Files
8 changes: 4 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"arrowParens": "always",
"singleQuote": true
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false
}
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"recommendations": [
"esbenp.prettier-vscode"
]
}
"recommendations": ["esbenp.prettier-vscode"]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": false,
"editor.tabSize": 2
}
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM eclipse-mosquitto:1.6.15-openssl

COPY mosquitto/basic.conf ./mosquitto/config/mosquitto.conf
RUN apk add --update --no-cache openssl && \
mkdir /mosquitto/config/certs && \
cd /mosquitto/config/certs && \
openssl genrsa -out ca.key 2048 && \
openssl req -x509 -new -nodes -key ca.key -days 3650 -out ca.crt -subj '/CN=My Root' && \
openssl req -new -nodes -out server.csr -newkey rsa:2048 -keyout server.key -subj '/CN=Mosquitto' && \
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 3650 && \
c_rehash . && \
chown -R mosquitto:mosquitto /mosquitto && \
chmod 600 /mosquitto/config/certs/*

EXPOSE 1883
EXPOSE 8883
15 changes: 15 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2025 Rob Griffiths

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
52 changes: 41 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,57 @@

[![Node.js Package](https://github.com/bytespider/Meross/actions/workflows/npm-ghr-publish.yml/badge.svg)](https://github.com/bytespider/Meross/actions/workflows/npm-ghr-publish.yml)

Tools to help configure the Meross devices for purpose of utilising our <a href="https://github.com/bytespider/Meross/wiki/MQTT">own MQTT servers</a>.
Tools to help configure the Meross devices to use private MQTT servers.

Before you can use the tool to setup your device you need to put it into paring mode and connect to it's Access Point. It's IP address is known as the `--gateway` parameter and is typically `10.10.10.1`.
## Requirements

Requires `node` v18+.
NodeJS: ^21.0.0, ^20.10.0, ^18.20.0
NPM: ^10.0.0

## Home Assistant
## Setup

It's possible to get these devices to work with Home Assistant (HASSIO).
<a href="https://github.com/bytespider/Meross/wiki/Home-Assistant-(HASSIO)">Setup Home Assistant MQTT</a>
TODO:
[Devices with WIFI pairing]()

Once paired and linked to your broker, you can use the <a href="https://github.com/krahabb/meross_lan">Meross Lan</a> integration to control the devices.
[Devices with Bluetooth pairing]()

## Tools

### Info

`npx meross info [--include-wifi]`
Gets information from the device you are connected to in setup mode and optionally the WIFI SSID's it can see.
```
npx meross-info [options] <options>

Options:
-V, --version output the version number
-a, --ip <ip> Send command to device with this IP address (default: "10.10.10.1")
-u, --user <user-id> Integer id. Used by devices connected to the Meross Cloud
-k, --key <shared-key> Shared key for generating signatures (default: "")
--include-wifi List WIFI Access Points near the device
--include-ability List device ability list
--include-time List device time
-v, --verbose Show debugging messages
-h, --help display help for command
```

### Setup

`npx meross setup [options]`
Setup device you are connected to in setup mode
```
npx meross-setup [options] <options>

Options:
-V, --version output the version number
-a, --ip <ip> Send command to device with this IP address (default: "10.10.10.1")
--wifi-ssid <wifi-ssid> WIFI Access Point name
--wifi-pass <wifi-pass> WIFI Access Point password
--wifi-encryption <wifi-encryption> WIFI Access Point encryption (this can be found using meross info --include-wifi)
--wifi-cipher <wifi-cipher> WIFI Access Point cipher (this can be found using meross info --include-wifi)
--wifi-bssid <wifi-bssid> WIFI Access Point BSSID (each octet separated by a colon `:`)
--wifi-channel <wifi-channel> WIFI Access Point 2.5GHz channel number [1-13] (this can be found using meross info --include-wifi)
--mqtt <mqtt-server> MQTT server address
-u, --user <user-id> Integer id. Used by devices connected to the Meross Cloud (default: 0)
-k, --key <shared-key> Shared key for generating signatures (default: "")
-t, --set-time Configure device time with time and timezone of current host
-v, --verbose Show debugging messages (default: "")
-h, --help display help for command
```
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

47 changes: 0 additions & 47 deletions bin/meross-info

This file was deleted.

115 changes: 0 additions & 115 deletions bin/meross-setup

This file was deleted.

Loading
Loading