-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSS560 Dimmer Support.... #39
Comments
Hi Stan, In the meanwhile, would you please post the output of the following script? from meross_iot.api import MerossHttpClient
from meross_iot.supported_devices.power_plugs import set_debug_level
from logging import DEBUG
import csv, io
EMAIL = 'YOUR_EMAIL'
PASSWORD = 'YOUR_PASSWORD'
client = MerossHttpClient(email=EMAIL, password=PASSWORD)
devices = client.list_supported_devices()
def sanitize_personal_info(d):
if isinstance(d, dict):
for key, value in d.items():
k = key.lower()
if isinstance(value, dict):
sanitize_personal_info(value)
elif isinstance(value, str) and (k == 'uuid' or k=='macaddress' or k == 'wifimac' or k == 'userid' or k=='bssid' or k =='ssid'):
d[key] = 'X'
elif isinstance(d, list):
for k in d:
sanitize_personal_info(k)
return d
if __name__ == '__main__':
set_debug_level(DEBUG)
output = io.StringIO()
writer = csv.writer(output, delimiter=';')
for d in devices:
r = []
r.append(d._type)
r.append(d._hwversion)
r.append(d._fwversion)
r.append(sanitize_personal_info(d.get_sys_data()))
r.append(sanitize_personal_info(d.get_channels()))
abilities = d.get_abilities()
r.append(sanitize_personal_info(abilities))
r.append(sanitize_personal_info(d.get_channels()))
writer.writerow(r)
print("\n\n---------------------------------------")
print(str(output.getvalue())) Be aware that you need to update the library to the latest version (0.2.0.1) and to fill in your EMAIL and PASSWORD in the relative script variables. Also, before posting the output of the script, make sure you clean any MAC address/User-Id/Signature. |
Sorry, I was out for a few days... I am tempted to try to reflect this to my mosquito server as I have seen a few others try.... --> {"payload": {}, "header": {"from": "/app/200021-57e25ec3ab97a7277eb2fe0068098228/subscribe", "sign": "XXXX", "messageId": "268ac24576575c8d74617ba9a9f9ffeb", "payloadVersion": 1, "namespace": "Appliance.System.All", "timestamp": 1555555720, "method": "GET"}} mss560m;3.0.0;3.1.5;{'all': {'digest': {'triggerx': [], 'timerx': [], 'light': {'rgb': -1, 'temperature': -1, 'channel': 0, 'luminance': 60, 'capacity': 4}, 'togglex': [{'onoff': 0, 'lmTime': 1555206805, 'channel': 0}]}, 'system': {'online': {'status': 1}, 'hardware': {'version': '3.0.0', 'subType': 'us', 'macAddress': 'X', 'chipType': 'mt7682', 'type': 'mss560m', 'uuid': 'X'}, 'time': {'timestamp': 1555555719, 'timezone': 'America/New_York', 'timeRule': [[1552201200, -14400, 1], [1572760800, -18000, 0], [1583650800, -14400, 1], [1604210400, -18000, 0], [1615705200, -14400, 1], [1636264800, -18000, 0], [1647154800, -14400, 1], [1667714400, -18000, 0], [1678604400, -14400, 1], [1699164000, -18000, 0], [1710054000, -14400, 1], [1730613600, -18000, 0], [1741503600, -14400, 1], [1762063200, -18000, 0], [1772953200, -14400, 1], [1793512800, -18000, 0], [1805007600, -14400, 1], [1825567200, -18000, 0], [1836457200, -14400, 1], [1857016800, -18000, 0]]}, 'firmware': {'version': '3.1.5', 'port': 2001, 'compileTime': '2019/03/19 17:22:32 GMT +08:00', 'server': 'iot.meross.com', 'userId': 200021, 'innerIp': '192.168.0.0', 'wifiMac': 'X'}}}};[{}];{'Appliance.Control.Bind': {}, 'Appliance.Control.TriggerX': {}, 'Appliance.System.Runtime': {}, 'Appliance.Control.Unbind': {}, 'Appliance.Config.Calibration': {}, 'Appliance.Config.Wifi': {}, 'Appliance.System.Online': {}, 'Appliance.Config.WifiList': {}, 'Appliance.System.Report': {}, 'Appliance.System.Ability': {}, 'Appliance.Control.TimerX': {'sunOffsetSupport': 1}, 'Appliance.Digest.TimerX': {}, 'Appliance.Digest.TriggerX': {}, 'Appliance.Control.Light': {'capacity': 4}, 'Appliance.Control.Multiple': {'maxCmdNum': 5}, 'Appliance.System.All': {}, 'Appliance.Config.Trace': {}, 'Appliance.System.Hardware': {}, 'Appliance.System.Time': {}, 'Appliance.System.Position': {}, 'Appliance.System.Firmware': {}, 'Appliance.System.Debug': {}, 'Appliance.Config.Key': {}, 'Appliance.Control.ToggleX': {}, 'Appliance.Control.Upgrade': {}};[{}] |
OK, Loaded your last update 0.2.2.1 and started playing.
from meross_iot.supported_devices.power_plugs import GenericPlug
The mss560 dimmer obviously does not support rgb, but the 'light' payload has it (the mss560 ignores the value). It initially failed with your default of capability=5 and this dimmer is a capability of 4 (This can be seen in the capability dumps above). Using your example code and modifying it to have a capability of 4 works! Here is modified line from my edited example...
The rgb values are a don't care as the ack response always returns a -1 (same for temperature). The ack which comes back shows the previous luminance value so it you want the current (new) value - you would have to ask for the status after it changed. Bottom line - If you document it, and make the change to device_factory.py you can say you support the mss560. BTW - you might consider selecting which object to create based upon the existence of the 'Light' payload.... As a last comment, I like a few others would like to control this locally without the use of the meross server. I have gotten it to work to my local Mosquitto server and will moving this direction going forward. Thanks for your great work... |
Hi @shodge12 , Regarding your comment about using the library locally, there already are people doing so. They simply did not document the way they achieved the goal, but the library should work fine. Anyways, I'm planning to document it, but I have some other tasks in the todo-list that come first (for instance I am currently re-writing the entire library to be more robust, async-ready and easier to use). So, keep in touch since I'll need the help of you people to make sure the new version of the library works as expected! |
I did a pull against 0.2.2.3 - just reporting that all is well with dimming using capacity=4. -Stan |
Found your code referencing the control of MEROSS devices. I picked up a dimmer from amazon [hoping it was Tasmota compatible - alas no].
https://smile.amazon.com/gp/product/B07KM4P4Z1/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1
I ran your test code on the device and it did turn on and off. This is also a dimmer and seems to have a 'luminance': 60 parameter. Any chance of a small change to add a DIM ability to the device?
Here is my output from the device info....
Thanks!
BTW - really looking forward to direct MQTT support...
-Stan
The text was updated successfully, but these errors were encountered: