Giter Club home page Giter Club logo

sonoffdiy2mqtt's Introduction

sonoffdiy2mqtt

Sonoff DIY mode devices to MQTT bridge (Sonoff Basic R3 and Sonoff Mini)

Installation

sudo apt install python3-pip 
git clone https://github.com/enesbcs/sonoffdiy2mqtt.git
cd sonoffdiy2mqtt
sudo pip3 install paho-mqtt requests zeroconf
python3 sonoffdiy2mqtt.py

Usage

At first run without much configuration the sonoffdiy2mqtt.py will write out to the console to the Sonoff DIY plug ID's that it found through mDNS.

1/ In the "sonoffdiy2mqtt.json" file the default mode is "mqtt_type": "domoticz". The Sonoff Device ID (ten character hexadecimal) has to be added to the "sonoff_device_id" fields and its correspondent Domoticz Dummy device IDX has to be added in the same line to the "outlet0" field. Default Publish Topic is "domoticz/in" and Subscribe is "domoticz/out", leave empty if you are not sure what you are doing.

Necessarry Domoticz Hardwares: "MQTT Client Gateway with Lan interface" and "Dummy"

2/ There are an other mode, if inside the "sonoffdiy2mqtt.json" file the "mqtt_type": "shelly" is setted then the sonoffdiy2mqtt script translates incoming mDNS messages to Shelly API compatible MQTT messages and paths, which can be intercepted by the Domoticz hardware "Shelly MQTT". ( https://github.com/enesbcs/Shelly_MQTT )

In this mode IDX is not required, but make sure to enable device self-learning.

Earlier Sonoff Device LAN mode support

https://github.com/enesbcs/sonofflan2mqtt

PayPal
donate
If you like this project, or you wants to support the development, you can do that with the paypal link above or by doing pull requests, if you knew Python language.
ko-fi

sonoffdiy2mqtt's People

Contributors

enesbcs avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

javipj

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.