Page 1 of 1

Script for MEROSS MSS425E Smart Power Stripe

Posted: Wednesday 12 December 2018 17:23
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

Re: Script for MEROSS MSS425E Smart Power Stripe

Posted: Thursday 13 December 2018 8:02
by manutremo
Have you tried the Tuya plug-in? It looks like it may work with this device.

Re: Script for MEROSS MSS425E Smart Power Stripe

Posted: Thursday 13 December 2018 8:39
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

Re: Script for MEROSS MSS425E Smart Power Stripe

Posted: Tuesday 15 January 2019 10:37
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.

Re: Script for MEROSS MSS425E Smart Power Stripe

Posted: Tuesday 15 January 2019 11:40
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

Re: Script for MEROSS MSS425E Smart Power Stripe

Posted: Tuesday 15 January 2019 17:13
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 3281 times