Skip to main content

Broadlink Listener

pypi python Build Status codecov

Broadlink IR codes listener and SmartIR json generator.

This project will install a broadlink-listener command line tool that can be used to generate a climate SmartIR compatible json, starting from an initial structure that defines climate behavior, putting Broadlink IR remote to listening state, until all IR code combination will being scan.

Features

  • Discover Broadlink IR remote
  • Starting from SmartIR json structure like
{
  "supportedController": "Broadlink",
  "minTemperature": 16,
  "maxTemperature": 31,
  "precision": 1,
  "operationModes": [
    "op_a",
    "op_b"
  ],
  "fanModes": [
    "fan_a",
    "fan_b"
  ],
  "swingModes": [
    "swing_a",
    "swing_b"
  ]
}

it helps you listen all the defined IR codes to create a json like

{
  "supportedController": "Broadlink",
  "minTemperature": 16,
  "maxTemperature": 31,
  "precision": 1,
  "operationModes": [
    "op_a",
    "op_b"
  ],
  "fanModes": [
    "fan_a",
    "fan_b"
  ],
  "swingModes": [
    "swing_a",
    "swing_b"
  ],
  "commands": {
    "off": "...",
    "op_a": {
        "fan_a": {
            "swing_a": {
                "16": "....",

                "31": "...."
            },
            "swing_b": {
                "16": "....",

                "31": "...."
            }
        },
        "fan_b": {
            "swing_a": {
                "16": "....",

                "31": "...."
            },
            "swing_b": {
                "16": "....",

                "31": "...."
            }
        }
    },
    "op_b": {
        "fan_a": {
            "swing_a": {
                "16": "....",

                "31": "...."
            },
            "swing_b": {
                "16": "....",

                "31": "...."
            }
        },
        "fan_b": {
            "swing_a": {
                "16": "....",

                "31": "...."
            },
            "swing_b": {
                "16": "....",

                "31": "...."
            }
        }
    }
  }
}
  • Mandatory fields into starting json
    • supportedController, minTemperature, maxTemperature, precision
  • Optional fields (at least one must be present or nothing will be listened):
    • operationModes, fanModes,swingModes
  • Generated file can be used into SmartIR HomeAssistant component
  • It's possible to interrupt with CTRL-C at any moment, a temporary file will be saved
  • Temporary files are also saved at the end of each temperature range
  • In case of existing temporary file, the already learnt combination will be skipped

Example

Example of cli command:

$ broadlink-listener generate-smart-ir ./real_data/1124.json <DEVICE_TYPE> <IP> <MAC_ADDR> -n dry -n fan_only -s eco_cool

real_data/1124.json file is this one from SmartIR GitHub repo in which I've added the missing "swingModes" array, supported by climate but not present on json:

"swingModes": [
  "auto",
  "high",
  "mid_high",
  "middle",
  "mid_low",
  "low",
  "swing"
],

<DEVICE_TYPE>, <IP>, <MAC_ADDR> parameter can be obtained running:

$ broadlink-listener discover_ir

Credits

This package was created with Cookiecutter and the gpongelli/cookiecutter-pypackage project template.

Metadata

Release files for broadlink-listener 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for broadlink-listener 1.2.0
File Size Uploaded Provenance Actions
broadlink_listener-1.2.0.tar.gz 19.3 kB Without provenance Details for broadlink_listener-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for broadlink-listener 1.2.0
File Interpreter ABI Platform Actions
broadlink_listener-1.2.0-py3-none-any.whl Python 3 none any Details for broadlink_listener-1.2.0-py3-none-any.whl

Total release size: 32.5 kB

Security for broadlink-listener 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page