Skip to content

Forked OctoLight to support Home Assistant controlled lights instead of GPIO

Notifications You must be signed in to change notification settings

Nick-Gatti/OctoLight_Home-Assistant

 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 75.5%
  • Jinja 17.6%
  • JavaScript 6.7%
  • CSS 0.2%