Comments (12)
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.
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.
@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.
@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.
from fauxmo-plugins.
@Perforex awesome!
- 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).
- 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.
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.
from fauxmo-plugins.
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.
@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.
Doing what right? The PR?
I'm no expert on the MQTT part.
Will review your new PR when you submit.
from fauxmo-plugins.
Merged into dev with d2cfea3
from fauxmo-plugins.
Related Issues (16)
- Include now required path in sample config in comments for built in plugins HOT 1
- commandlineplugin sample json file not found HOT 1
- Home Assistant Python bindings deprecated HOT 2
- small typo to be corrected HOT 1
- mqqt library missing HOT 3
- unable to use get_state 'unknown' return with success. HOT 5
- commandlineplugin, echo, single quotes... confused HOT 4
- MQTTPlugin: "device doesn't support that" error HOT 4
- GetBinaryState fails if state is not in {`on`, `off`} which prevents adding new devices with unknown state HOT 29
- The fauxmo on|off|unknown statuses should probably be enums, not strings
- The mqtt loop should probably always be running HOT 1
- Add `get_state` methods for the new GetBinaryState command
- 'MQTTPlugin' object has no attribute '_latest_action' HOT 5
- Unable to do discovery HOT 2
- commandlineplugin example is missing a comma in the plugin. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fauxmo-plugins.