Coder Social home page Coder Social logo

MQTT plugin about fauxmo-plugins HOT 12 CLOSED

n8henrie avatar n8henrie commented on September 9, 2024
MQTT plugin

from fauxmo-plugins.

Comments (12)

SupraJames avatar SupraJames commented on September 9, 2024

I am here looking for an MQTT plugin and my requirements are kinda like yours. I don't care (much) about security, if someone's on my internal network they are welcome to control my lights!

If you do hack something together, please let me know, and I'd be happy to test.

from fauxmo-plugins.

n8henrie avatar n8henrie commented on September 9, 2024

I think an MQTT plugin would be sweet. I don't use it a whole lot, but I know the IOT community seems to love it overall.

FYI, for the few MQTT devices I do use, I have them integrated through Home Assistant by way of mosquitto, and Fauxmo works with them just fine through the Home Assistant plugin.

For people not interested in running things through Home Assistant, a direct MQTT plugin would probably be much appreciated.

from fauxmo-plugins.

Perforex avatar Perforex commented on September 9, 2024

@SupraJames - Thanks, I'll certainly keep you up to date on progress and testing would me much appreciated.
@n8henrie - Thanks, I'm sort of in the second boat, I already have devices that work well through MQTT and whilst I could use Home Assistant, I'd rather not go down that route.

from fauxmo-plugins.

Perforex avatar Perforex commented on September 9, 2024

@n8henrie
Code developed and tested, looking good so far but external testing is welcomed.

A couple of questions for you:

  • Do you need to add me as a contributor before I have write access to create a Pull Request or is the default write?
  • I've introduced a new module (paho-mqtt) and I'm not sure how that should be handled in terms of packaging. Advice and guidance welcomed.

Help with these two gratefully received.

from fauxmo-plugins.

SupraJames avatar SupraJames commented on September 9, 2024

from fauxmo-plugins.

n8henrie avatar n8henrie commented on September 9, 2024

@Perforex awesome!

  1. No, like most GitHub repos, anyone can make a pull request. This allows everyone to review the changes before they are merged and for the continuous integration tests to run (if any).
  2. Dependencies (and pinned version numbers) should be added to the module-level docstring. Search the readme for dependenc, see my examples, and let me know how I can further clarify.

from fauxmo-plugins.

Perforex avatar Perforex commented on September 9, 2024

Thank you both for your help and advice. As you can probably tell I'm new to the collaborative use of git but it's a great learning experience. I've forked the plugin, added the new module (including the docstring for dependencies) and raised the pull request. #6

I hope this is all as per convention and I look forward to the next stage in the process. :-)

from fauxmo-plugins.

n8henrie avatar n8henrie commented on September 9, 2024

from fauxmo-plugins.

SupraJames avatar SupraJames commented on September 9, 2024

Perforex, just testing this and it is also working for me, so thanks!

I do see that your code is connecting, publishing, and disconnecting to the MQTT server for each call, which doesn't seem ideal, but I'm equally new to this.

Perhaps you can do self.client = mqtt.Client() and self.client.connect(self.qserver,self.qport,60) in init and just publish messages in the handlers for on and off.

I've tested locally that change and seems to work OK. I'm supposing that the MQTT library itself will take care of re-connecting to the broker as required.

from fauxmo-plugins.

Perforex avatar Perforex commented on September 9, 2024

@SupraJames
Thanks James, glad it's working. I've just had a look at your changes and I like your thinking, it does seem more efficient to do the connection once. I'll merge your changes so that it can be incorporated into the final pull request. (I think that's the way it's supposed to happen...)

@n8henrie
Please advise if we're doing this right, thanks.

from fauxmo-plugins.

n8henrie avatar n8henrie commented on September 9, 2024

Doing what right? The PR?

I'm no expert on the MQTT part.

Will review your new PR when you submit.

from fauxmo-plugins.

n8henrie avatar n8henrie commented on September 9, 2024

Merged into dev with d2cfea3

from fauxmo-plugins.

Related Issues (16)

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.