Script for MEROSS MSS425E Smart Power Stripe

Python and python framework

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Script for MEROSS MSS425E Smart Power Stripe

Post by emme »

Ciao,

I finally found a way to figure out how to access my Meross MSS425E
Image

yes, it works with Alexa, but I want to access it via Domoticz, and since there is no way to interact Alexa from Domoticz, this is the best solution I found :P

Requirements:
- Python >= 3.6
- Meross IOT API Client https://github.com/albertogeniola/MerossIot
this script stored in the /home/pi folder:

Code: Select all

#!/usr/bin/env python3.6

from sys import argv
from meross_iot.api import MerossHttpClient

mDev = int(argv[1])
mCh  = argv[2]          # ch 1-2-3-USB
mVal = int(argv[3])     # 0 = Off / 1 = On

print("parametri:" + argv[1] + " / " + argv[2] + " / " + argv[3])

mConnect = MerossHttpClient(email="YOUR REGISTERED EMAIL", password="YOUR PASSWORD")
mDevices = mConnect.list_supported_devices()

if mCh != "USB":
        mCh = int(mCh)
        if mVal == 0:
                mDevices[mDev].turn_off_channel(mCh)
        else:
                mDevices[mDev].turn_on_channel(mCh)
else:
        if int(mVal) == 0:
                print("DISABILITA USB")
                mDevices[mDev].disable_usb()
        else:
                print("ABILITA USB")
                mDevices[mDev].enable_usb()
Usage:
The command line script needs 3 parameters:
- Device ID (strat from 0)
- Device Channel (1,2,3,USB)
- Channel Value (1-On, 0-Off)
Create a virtual (Dummy) Switch
in the On Action enter the following (ex. USB):
script:///home/pi/meross.py 0 USB 1
in the Off Action enter the following (ex. USB):
script:///home/pi/meross.py 0 USB 0

that's all :P
as easy as it gets :P
The most dangerous phrase in any language is:
"We always done this way"
manutremo
Posts: 69
Joined: Saturday 19 November 2016 17:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Script for MEROSS MSS425E Smart Power Stripe

Post by manutremo »

Have you tried the Tuya plug-in? It looks like it may work with this device.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Script for MEROSS MSS425E Smart Power Stripe

Post by emme »

yes I did, but could not find the device.
the issue is based on 2 different situations:
1) Meross does not use Tuya chipset on this device
2) Meross uses its own cloud (eu-iot.meross.com)

My intention would be to try to subscribe the MQTT IoT network from meross and check what's happend :P :P
The most dangerous phrase in any language is:
"We always done this way"
CLEMENT99
Posts: 36
Joined: Friday 26 January 2018 9:18
Target OS: Windows
Domoticz version: BETA
Location: Brussels
Contact:

Re: Script for MEROSS MSS425E Smart Power Stripe

Post by CLEMENT99 »

@emme

Thx for this script, I'm also using https://github.com/albertogeniola/MerossIot to get the value of my meross plug but to use a schedule cmd (windows) to update the value of the dummy device.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Script for MEROSS MSS425E Smart Power Stripe

Post by emme »

since I'm not so skilled I used a workaround on that...
I use status from Amazon Echo (alexa) from nodered to gather the status and update Domoticz :P :P

quite wired but it works so far :P
The most dangerous phrase in any language is:
"We always done this way"
CLEMENT99
Posts: 36
Joined: Friday 26 January 2018 9:18
Target OS: Windows
Domoticz version: BETA
Location: Brussels
Contact:

Re: Script for MEROSS MSS425E Smart Power Stripe

Post by CLEMENT99 »

emme wrote: Tuesday 15 January 2019 11:40 since I'm not so skilled I used a workaround on that...
I use status from Amazon Echo (alexa) from nodered to gather the status and update Domoticz :P :P

quite wired but it works so far :P
Yes, it's also possbile to use IFTTT
Create a dummy device type switch.
Create 2 applets in IFTTT
In domoticz settings specify your IFTTT credentials
Change dummy device to call applets (see below) with the applet name and key
sample call -> https://maker.ifttt.com/trigger/applet- ... applet-key

Capture.JPG
Capture.JPG (29.99 KiB) Viewed 3109 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest