opengridcc / opengrid-dev

Open source building monitoring, analysis and control
Apache License 2.0
26 stars 21 forks source link

Slackbot for allerting #149

Open JrtPec opened 8 years ago

saroele commented 8 years ago

The idea:

saroele commented 8 years ago

Most important alert: when there is no data since xxx hours/days/...

saroele commented 8 years ago

to send an image without fysically writing a file to disk, this is probably a good start: http://stackoverflow.com/questions/28102803/python-pil-image-how-to-save-image-to-a-buffer-so-can-be-used-later

JrtPec commented 8 years ago

I would use BytesIO instead of StringIO though, something like this:

from io import BytesIO
import requests

image_buffer = BytesIO()
plt.save_image(..., file=image_buffer)  # or whatever you do to save a plot to file

files = {'file': image_buffer.getvalue()}
r = request.post(url, files=files)