Giter VIP home page Giter VIP logo

presence-light-ha-api's Introduction

Presence Light Home Assistant API Bridge

Creates a FastAPI bridge to Home Assistant for use with the simplified Custom API interface in Presence Light

How to use

  1. Download the Docker file from here
  2. Run the Docker file on a server of your choice (including your local machine)
  3. Get a Long-lived Access Token from your Home Assistant installation
  4. Set the following environment variables in Docker:
    • HA_IP: The IP Address or FQDN of your Home Assistant installation that the Docker container will be able to access
    • HA_PORT: The port that your Home Assistant installation runs on (Normally, this is 8123)
    • HA_ENTITY: The entity name of the light you want to use in the <domain>.<name> format. (I use light.office_status_light in mine.)
      • Note: This light must support RGB, or this application will fail
    • HA_TOKEN: The long-lived access token you generated earlier
    • HA_BRIGHTNESS: An integer between 0 and 100
  5. Run the Docker container with the command docker run -d --restart=unless-stopped -e "HA_IP=<your-ip>" -e "HA_PORT=<your-port>" -e "HA_ENTITY=<domain>.<name>" -e "HA_TOKEN=<your-token>" -e "HA_BRIGHTNESS=<your-brightness>" --name=presence-light-ha-api loganjlong/presence-light-ha-api
  6. Set the Custom API values in Presence Light. You should replace the IP and port seen below with the IP and port of this Docker container (not your Home Assistant installation). All calls in this application use POST. Example Custom API Config

API Behavior

  • /available: Sets the light green
  • /away: Sets the light yellow
  • /busy: Sets the light red
  • /offline: Turns the light off

presence-light-ha-api's People

Contributors

loganjohnlong avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

presence-light-ha-api's Issues

How to wire this up to just a switch?

Hi - I am trying to wire your solution up to a switch in HA. Basically, I'd like your solution to not be so dependent on setting a color, but just for example set the attribute of the light to busy/away. That way I can then look at the atribute in HA and turn on/off my switch

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.