OllisGit / OctoPrint-DisplayLayerProgress

OctoPrint-Plugin
GNU Affero General Public License v3.0
120 stars 24 forks source link

Feature Request/Question #269

Closed john-k-mcdowell closed 2 years ago

john-k-mcdowell commented 2 years ago

Plug-in works great, thanks for your hard work. I would like to get the layer number/total layers into HomeAssistant. This would allow me to trigger notifications/automations based on the layer that is printing. Initial use case is for anticipating when it will be ready for changing filament for multi-color prints. I am currently using the OctoPrint HomeAssistant integration. I think there are two ways to do this.

  1. I could shift to shift to MQTT if the output of your plugin were published on MQTT which would be a new feature request for you.
  2. I can create several new sensors using HomeAssistant REST calls. I have tried using the example you provided but can't get it to work (I get connection refused on my call, so either the port number or the API Key I am using are wrong). Is there any more documentation available.
john-k-mcdowell commented 2 years ago

I have been doing some more digging on this. I think if I shift to MQTT, then your plug-ins events should be published to MQTT by the MQTT plug-in. If that is true, then I will get entities for your values in HomeAssistant. I have a print currently running, but once it is done, I will shift over and report back if this works as expected.

john-k-mcdowell commented 2 years ago

I have confirmed that with the MQTT plugin I get the event info into HA which includes the layer information. I will have to build a sensor to parse the layer data out of the events, but this will give me what I was looking for. I will close this request out. thanks