Extending printer status

Howdy all.

So I've been playing around with integrating my printer in to my home automations, and I've come to realise that there's more that could be done if the printer status states could be extended.

For example, it'd be useful to know whether during the start of a print the printer is in bed heatup phase, hotend heatup, bed leveling, etc.
Whereas instead we just have an "operational", "printing" or various error states.

Think this would be feasible with a plugin? Likely a secondary state rather than adding in to the list of normal states for compatibility reasons....

Fully doable in a plugin (there's not much that can't) - you could listen for heating gcodes, then track the temperatures to work out when heating is finished, for example.

How you choose to send that information to your home automation stuff is up to you - there's things like MQTT that are already established (and there's a plugin) or roll your own solution. Anything that can be done in Python can be done in an OctoPrint plugin.