beveradb / pysonofflan

Python interface for controlling Sonoff smart switches/plugs running original Itead firmware, locally, in "LAN mode".
MIT License
30 stars 37 forks source link

support integration of sonoff devices with MQTT #25

Open ivanfmartinez opened 5 years ago

ivanfmartinez commented 5 years ago

Description

To make easier to integrate with home automation systems, in my case openhab.

What I Did

I have started a gateway using this library.

The code is available here : https://github.com/ivanfmartinez/pysonofflan/blob/mqtt_gateway/sonoff_mqtt.py

Tested with sonoff basic devices. I have one 4CH Pro device that I will integrate after #6 is solved.

Please send suggestions

beveradb commented 5 years ago

Sorry for taking so long to respond to this, I've had a busy month.

This looks awesome, thank you for your contribution!

I'm not sure of what exactly you were looking for from me here, but if you submit that code as a pull request to this project (perhaps with some tests?) I'm happy to review and merge?

ivanfmartinez commented 5 years ago

I will wait for the #45 merge because I found some problems that are related to this.

After the merge I will make more changes in the code and later send a PR.

mattsaxon commented 5 years ago

@ivanfmartinez, #45 is merged now.