Code Monkey home page Code Monkey logo

broadlinkmqttsetup's Introduction

broadlinkMqttSetup

A tutorial on how to setup broadlink mqtt for use with Home-Assistant

Current state: Works on my machine

Dependencies

We'll be using MQTT as our backbone. So you'll need an MQTT broker, and this will be the client that'll bridge MQTT to our Broadlink device: Broadlink-mqtt

Step 1: Getting the codes

As noted on the Broadlink page on HA docs, you can export the codes from your e-remote app. This is by far the easiest way of doing it in bulk.
Another way is finding a list of codes like this, but you won't find this for all your devices.

Step 2: Import those codes into Broadlink-mqtt (rather than learning them one by one)

Start by cloning this repo locally

git clone https://github.com/MrBramme/broadlinkMqttSetup.git

Drop the exported codes from Step 1 in the folder 1. Importing codes. You'll notice mine in there. Next run the python code to create a json file of your codes:

cd 1.\ Importing\ codes/
python readCodes.py

This will create a json file named output.json with the codes from the text files. In that json file you'll see a suggested topic based on the filename & button name from your e-remote app. If no name found, it'll put "unknown" there.

The next step is to check those topics. So open up the output.json and check them, don't like them? Simply adjust them :)

Next up is to import them in the commands folder of our broadlink-mqtt client. This, of course, has to happen on the actual device that'll run that client, or run it on your current device and copy the commands folder to the client-device. Note: I've ran this when the command folder was non-existant. So if you allready have a folder, make sure to back it up first.

so: place your output.json file in the same folder as the script found in 2. Create commands. and then smply run:

python createCommands.py

It'll request you to select the output:

  • Only the command folder(s)
  • Only the HA config to paste into home assistant
  • Both the commands and the home assistant config

Step 3: Putting it all together

In this step you should have the command folder structure set up as required for Broadlink-mqtt and you can fire up that client. Perform some tests if you like to make sure the topics are to your linking. Next, use the example HA config file to jumpstart your switches config in HA, or make your own.

Done!

Links

broadlinkmqttsetup's People

Contributors

mrbramme avatar

Watchers

 avatar  avatar  avatar

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.