derekantrican / OctoPrint-Webhooks

Make OctoPrint events call your custom webhooks!
GNU Affero General Public License v3.0
7 stars 1 forks source link

Feature Request - Include tool/bed temps (both actual and target) #16

Open Rockster160 opened 6 months ago

Rockster160 commented 6 months ago

Self-explanatory! Essentially just including the data from the /api/printer endpoint. The state is already included, but I'd like to have the temperature key as well for monitoring/external display. I looked around the docs and don't see an option to include this in the custom params, so apologies if I've missed something.

{
  "sd": {
    "ready": false
  },
  "state": {
    "error": "",
    "flags": {
      "cancelling": false,
      "closedOrError": false,
      "error": false,
      "finishing": false,
      "operational": true,
      "paused": false,
      "pausing": false,
      "printing": true,
      "ready": false,
      "resuming": false,
      "sdReady": false
    },
    "text": "Printing"
  },
  "temperature": {
    "W": {
      "actual": 0,
      "offset": 0,
      "target": null
    },
    "bed": {
      "actual": 50.23,
      "offset": 0,
      "target": 50
    },
    "tool0": {
      "actual": 199.55,
      "offset": 0,
      "target": 200
    }
  }
}

I'm a fellow developer- so might take a look at adding this and making a PR at some point in the future, but I'm pretty busy for the next little bit, so I'm not sure if I can get to it in a timely manner and figure somebody familiar with the code would hopefully be able to just toss this in fairly easily. 😁

derekantrican commented 6 months ago

Thanks for the suggestion!

I did a bit of light research and found this example: https://github.com/jneilliii/OctoPrint-PlotlyTempGraph/blob/master/examples/heater_temps.py however it seems that the "temperature data source" is from GCODE. That might help provide a solution for #15 as well, but for this feature, I feel like there's gotta be a better way...

Maybe worth posting in the community forums. I unfortunately don't have the time right now, but if you get around to prototyping it, let me know!