Coder Social home page Coder Social logo

kamkilt / irdb2broadlinkha Goto Github PK

View Code? Open in Web Editor NEW

This project forked from molexx/irdb2broadlinkha

0.0 0.0 0.0 17 KB

Script to scrape IR codes from irdb or parse lirc configs, convert them to Broadlink and output HASS' yaml

License: Apache License 2.0

Shell 100.00%

irdb2broadlinkha's Introduction

Summary

Creates HomeAssistant's .yaml containing Broadlink IR codes for entire remotes found in the irdb (https://github.com/probonopd/irdb/tree/master/codes) or lirc (https://sourceforge.net/p/lirc-remotes/code/ci/master/tree/remotes/) databases.

It is currently suggested to try irdb first as converting lirc devices is much slower right now

Download

Clone this git repo or download the script using curl:

curl https://raw.githubusercontent.com/molexx/irdb2broadlinkha/master/irdb2broadlinkha.bash -o irdb2broadlinkha.bash 

Dependencies

Will be automatically downloaded and stored in the work dir 'irdb2broadlinkha-work'.

pronto2broadlink.py from:

https://gist.githubusercontent.com/appden/42d5272bf128125b019c45bc2ed3311f/raw/bdede927b231933df0c1d6d47dcd140d466d9484/pronto2broadlink.py  

IrpTransmogrifier from:

https://github.com/bengtmartensson/IrpTransmogrifier

Usage

Find your remote in irdb under:

https://github.com/probonopd/irdb/tree/master/codes

note the path of the .csv file under the codes/ directory, e.g. Sky/Unknown_DVB-S/0,12.csv

or the lirc config under:

https://sourceforge.net/p/lirc-remotes/code/ci/master/tree/remotes/

note the path of the .lircd.conf file under the remotes/ directory, e.g. apple/A1294.lircd.conf

Then run this script with parameters:

  • The path to the .csv/.conf as determined above, or an irdb directory path to process all the remotes in that directory
  • Prefix to use for the switch id and friendly name in the HA config
  • (optional) search pattern to match the function name against - e.g. POWER. Useful for very large remotes or when pulling a directory full of remotes.

e.g.:

./irdb2broadlinkha.bash 'Sky/Unknown_DVB-S/0,12.csv' Sky_

This will output the YAML ready to be pasted into your HomeAssistant config.

To save it to a file use unix redirection >:

./irdb2broadlinkha.bash 'Sky/Unknown_DVB-S/0,12.csv' Sky_ >sky.yaml

As this can generate many lines it clutters up configuration.yaml so it is neater to have each IR device in its own file and include it from configuration.yaml. One way to do that is make a directory for the remotes - e.g. broadlink - then use HA's !include_dir_merge_named to merge all files contained in that directory into the broadlink switches configuration.

e.g., configuration.yaml:

- platform: broadlink
    mac: 'xx:xx:xx:xx:xx:xx'
    host: 192.168.1.xx
    timeout: 15
    friendly_name: "Broadlink"
    switches:
      !include_dir_merge_named broadlink

then run irdb2broadlinkha.bash for each remote:

./irdb2broadlinkha.bash 'Sky/Unknown_DVB-S/0,12.csv' Sky_ >~/.homeassistant/broadlink/sky.yaml  

   ./irdb2broadlinkha.bash 'Yamaha/Receiver/120%2C-1.csv' amp_ >~/.homeassistant/broadlink/yamaha_receiver.yaml

Discovery assistance mode

When you don't know which remote you need from irdb this tool can download all the remotes in a directory and process them all. Pass a search pattern (third parameter) of "POWER" to just get the power buttons, then go through them manually until you find the ones that work for your device. e.g.:

   ./irdb2broadlinkha.bash 'Yamaha/Receiver' amptest_ POWER >~/.homeassistant/broadlink/yamaha_all_test.yaml

irdb2broadlinkha's People

Contributors

molexx 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.