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
Install via the bundled Plugin Manager or manually using this URL:
https://github.com/mark-bloom/OctoLight_Home-Assistant/archive/master.zip
Alternatively:
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).
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.
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)
Maybe in the distant future: