Nick-Gatti / OctoLight_Home-Assistant

Forked OctoLight to support Home Assistant controlled lights instead of GPIO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OctoLight Home Assistant

A simple plugin that adds a button to the navigation bar for toggling a HomeAssistant connected Light.

Code forked from OctoLight by gigibu5 with HA integration based on OctoPrint-PSUControl by kantlivelong

WebUI interface

Setup

Install via the bundled Plugin Manager or manually using this URL:

https://github.com/mark-bloom/OctoLight_Home-Assistant/archive/master.zip

Configuration

Curently, you can configure four settings:

  • Address: The IP address or hostname of your HomeAssistant server. e.g. http://ip:port or http://hostname:port. Do not include a trailing slash /

  • Access token: The long-lived access token generated by HomeAssistant.

  • Entity ID: The Home Assistant ID of the entity you'd like to control. Currently must be a light device supporting the light/toggle action.

  • Verify certificate: Toggle on to verify TLS certificate and not connect on certificate issues (keep disabled if using http on local network).

Settings panel

API

UNTESTED in HA MOD Base API URL : GET http://YOUR_OCTOPRINT_SERVER/api/plugin/octolight?action=ACTION_NAME

This API always returns updated light state in JSON: {state: true}

(if the action parameter not given, the action toggle will be used by default)

Actions

  • toggle (default action): Toggle light switch on/off.
  • turnOn: Turn on light.
  • turnOff: Turn off light.
  • getState: Get current light switch state.

TO DO

  • Update interface if Light is turned on or off

Maybe in the distant future:

  • Turn off on finish print

About

Forked OctoLight to support Home Assistant controlled lights instead of GPIO


Languages

Language:Python 75.5%Language:Jinja 17.6%Language:JavaScript 6.7%Language:CSS 0.2%