Giter Site home page Giter Site logo

Comments (13)

albertogeniola avatar albertogeniola commented on July 25, 2024 1

Hi @virtualdj ,
yeah, the device is listed among the ones that are available. However, the library does not recognize its device id (MSS310H) so it doen't support that plug. Anyways, there are good chances that the hardware is supported by the library, but I cannot confirm it.

To better investigate, I can add the device ID among the ones that are supported and give you a new version of the library. You should "test it" and report it works or not. If it does, I will then release that version to the public. Would it be ok for you?

from merossiot.

albertogeniola avatar albertogeniola commented on July 25, 2024 1

Hi, you are on the right path. The problem is that the library is somehow referring to the wrong SSL module...

It seems you are using python3.4, while this library requires python 3.6+ to work correctly. Would you mind to update your python version and try again with the modified source?

from merossiot.

albertogeniola avatar albertogeniola commented on July 25, 2024 1

As far as I understood, you're now able to turn the plug ON and OFF, right?

Yes, confirmed!

I don't understand what the problem is.

You said earlier:

the message you see is just a debug message. The problem is that the status property is not updated and the getStatus might be wrong. I should investigate better on your device before adding explicit support to it. For now, I'll create the PR myself and add a warning message for MSS310H owners.

so what I noticed is that even with this new version, the library returns the same output than before (including the "UNKNOWN msg received by ..."). I though it wasn't your expected result... so I asked if there's anything you need to investigate and, if yes, then I'm at your disposal ;-)

Ah, yeah, I see now. Well, at the moment I cannot prepare any specific implementation to address that issue. But I really appreaciate your help and I'll ask you to test in case I end up with something. Thank you guys!

from merossiot.

virtualdj avatar virtualdj commented on July 25, 2024

Of course, I'm available to run test if you need!

Just FYI I've tried to add to device_factory.py the line:

elif device_type.lower() == "mss310h":
    return Mss310(token, key, user_id, **device_specs)

... hoping that the same "class" would be enough, but then I get:

user@ubuntu:~/meross$ python3 meross.py
Listing Devices...
Traceback (most recent call last):
  File "meross.py", line 11, in <module>
    devices = httpHandler.list_supported_devices()
  File "/usr/local/lib/python3.4/dist-packages/meross_iot/api.py", line 124, in list_supported_devices
    device = build_wrapper(self._token, self._key, self._userid, deviceType, dev)
  File "/usr/local/lib/python3.4/dist-packages/meross_iot/device_factory.py", line 14, in build_wrapper
    return Mss310(token, key, user_id, **device_specs)
  File "/usr/local/lib/python3.4/dist-packages/meross_iot/supported_devices/power_plugs.py", line 134, in __init__
    tls_version=ssl.PROTOCOL_TLS,
AttributeError: 'module' object has no attribute 'PROTOCOL_TLS'

Thanks!

from merossiot.

virtualdj avatar virtualdj commented on July 25, 2024

It seems you are using python3.4, while this library requires python 3.6+ to work correctly.

Oops, sorry, I didn't catch that! I've updated to python 3.6 on my old Ubuntu 14.04 LTS and set up the README example script to run with 3.6.

Then I edited the new /usr/local/lib/python3.6/dist-packages/meross_iot/device_factory.py as before and now I get a long (verbose) output with JSON (the print(jsondata) is still commented out).

I've attached a file, where I removed some personal information with "#", please let me know if there is other data which should not be kept here.

Anyway, the plug turns on and off, is the output correct? Shouldn't I get numerical output instead of raw JSON and errors?

from merossiot.

albertogeniola avatar albertogeniola commented on July 25, 2024

Well done, the output is ok. Output is in JSON format (dictionary object), so that is ok. Well done.
Why don't you test all the APIs on your device and propose a Pull Request so that MS310H owners can start using this library as well?

from merossiot.

virtualdj avatar virtualdj commented on July 25, 2024

Well done, the output is ok.

Including the UNKNOWN error messages?

Why don't you test all the APIs on your device and propose a Pull Request so that MS310H owners can start using this library as well?

OK, but I'm pretty new to Python (never worked with it apart streamlink), can you point me how should I do it (testing the API, not creating the PR).

from merossiot.

albertogeniola avatar albertogeniola commented on July 25, 2024

I've looked again at the code. It seems that your device is responding with a valid ACK to the ON-OFF but is not setting up the "toggle" property into the payload of the response. Anyways, the message you see is just a debug message. The problem is that the status property is not updated and the getStatus might be wrong. I should investigate better on your device before adding explicit support to it. For now, I'll create the PR myself and add a warning message for MSS310H owners.

image

from merossiot.

albertogeniola avatar albertogeniola commented on July 25, 2024

Alright, you can install the latest version of the package (0.1.4.3). If you want to update the existing library, you can issue the following command:

pip install --upgrade meross-iot

Let me know if it works as expected !

from merossiot.

virtualdj avatar virtualdj commented on July 25, 2024

Anyways, the message you see is just a debug message. The problem is that the status property is not updated and the getStatus might be wrong. I should investigate better on your device before adding explicit support to it. For now, I'll create the PR myself and add a warning message for MSS310H owners.

OK, I've updated the library and re-run the script but the output doesn't seem different from the previous one. It's attached here as meross-output-2.txt.

Let me know if you need further tests or different scripts to run to improve the library for MSS310H, I'm available.

from merossiot.

albertogeniola avatar albertogeniola commented on July 25, 2024

Hi virtualdj,
I don't understand what the problem is. As far as I understood, you're now able to turn the plug ON and OFF, right? If not, could you please explain better?

from merossiot.

virtualdj avatar virtualdj commented on July 25, 2024

As far as I understood, you're now able to turn the plug ON and OFF, right?

Yes, confirmed!

I don't understand what the problem is.

You said earlier:

the message you see is just a debug message. The problem is that the status property is not updated and the getStatus might be wrong. I should investigate better on your device before adding explicit support to it. For now, I'll create the PR myself and add a warning message for MSS310H owners.

so what I noticed is that even with this new version, the library returns the same output than before (including the "UNKNOWN msg received by ..."). I though it wasn't your expected result... so I asked if there's anything you need to investigate and, if yes, then I'm at your disposal ;-)

from merossiot.

zuno avatar zuno commented on July 25, 2024

Hello Alberto.

I confirm that mss310h works fine for me now.

Thankyou.

I'm available for tests if you need

from merossiot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.