Hello!
I'm a hardware engineer developing a multi-sensor board that will attach to a Raspberry Pi. The first part of the design - the temperature and humidity sensor is working on my Pi Zero (the development platform) but being a hardware guy, I'm getting a little lost in the Octoprint plug in world.
I've gotten to the point where my plugin will read the manufacturing ID from the sensor in a plugin shell and prints it to the log. I also have a standard python script that does the temperature/humidity conversion and prints the results - all good and sane so far. The problem comes when I try to get my plug in to be called on a regular basis. To do the conversion I have to initiate it with an i2c register write, then check a status bit to determine if it is complete. The conversion can take a reasonable amount of time (up to a second). Alternately I can set the sensor up to interrupt the processor with a GPIO transition on a predetermined rate (1/10/100 seconds) - but again, I have no idea how to make a plugin respond to that.
Ideally I would like to add the output of the conversions to the temp graph.
You might want to look into my plugin PlotlyTempgraph, it will allow fairly easy integration of the data into the graph. The enclosure plugin (which also supports temperature and humidity sensors) actually has a PR right now to integrate with it. And an example of how you can add the data from your own plugin into it can be found here. It's only putting in random data, but hopefully makes enough sense.