Skip to content

Forked OctoLight to support Home Assistant controlled lights instead of GPIO

Notifications You must be signed in to change notification settings

mark-bloom/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

Alternatively:

  • Download the repository code as a .zip
  • In the plugin manager of OctoPrint, go to "Get More"
  • Under "... from an uploaded file" select the .zip you downloaded to install.

Configuration

Curently, you can configure 8 settings, including 4 configuration items:

  • 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).

Operational settings [to be introduced in v0.4]

  • Turn on light on print start: Turn on the light when OctoPrint receives a "print started" message.

  • Turn off light on print end: Turn off the light when OctoPrint receives a "print complete" message.

  • Turn off light on print failure: Turn off the light when OctoPrint receives a "print failure" message.

  • Turn off light on print cancellation: Turn off the light when OctoPrint receives a "print cancellation" message.

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
  • Turn off on finish print (thank you Nick-Gatti)

Maybe in the distant future:

  • Add light settings (e.g. brightness and colour) for turn on

About

Forked OctoLight to support Home Assistant controlled lights instead of GPIO

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 75.1%
  • Jinja 18.0%
  • JavaScript 6.7%
  • CSS 0.2%