Git Product home page Git Product logo

flirc-home-assistant's Introduction

Flirc Home Assistant

This is a small set of scripts that can be used with Flirc to control your Home Assistant's lighting (and other things, in the future). Mainly running it on Windows, but it could easily be adapted into an OSX or Linux solution.

The flow is as follows:

  • Flirc toggles a keyboard shortcut when a particular remote button signal is sensed
  • AutoHotKey detects this shortcut and runs a batch file
  • The batch file runs the python script with the proper lighting parameters. Why a batch file? Because it allows the script to run minimized (open to suggestions on better ways to run this lol)
  • The python script uses Home Assistant's API to issue the lighting instruction for the desired group of lights

List of Keystrokes

Ctrl + Alt + ... U => 25% brightness I => 50% brightness O => 75% brightness P => 100% brightness

Prerequisites

  • Python's requests library needs to be available, install it by running: pip install requests
  • AutoHotKey, to reliably detect the keyboard shortcuts
  • A Home Assistant instance & corresponding API key to access it

Installation/Usage

  • Double click on the AutoHotKey script to begin detecting for keystrokes (useful to configure it to start on boot as well)
  • Bind your remote buttons in Flirc to the keystrokes listed above
  • Duplicate config.py.sample to config.py
  • Fill in the values

flirc-home-assistant's People

Contributors

casenjo avatar

Watchers

 avatar  avatar

flirc-home-assistant's Issues

Make proper flirc integration/addon for hass

Here are some references:

<?php // session_start();
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);

    function sendir($pattern, $repeat = 3) {
        $cmd = "irtools sendir --ik=23000 --repeat=" . $repeat . " --csv=\"" . $pattern . "\"";
        echo($cmd."<br>");
        exec($cmd);
    }

    $repeat = $_GET["repeat"] ?? 0;

    if (isset($_GET["pattern"])) {
        sendir($_GET["pattern"], $repeat);
    }
    // header("Location: " . "https://localhost/ir.php");
?>

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.