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

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

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()
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

as easy as it gets
