corvia / thermonitor Goto Github PK
View Code? Open in Web Editor NEWA hardware + web application to continuously monitor our farm and cafe thermometers and dispatch notifications.
Home Page: https://thermonitor.sqrts.com/
License: Other
A hardware + web application to continuously monitor our farm and cafe thermometers and dispatch notifications.
Home Page: https://thermonitor.sqrts.com/
License: Other
Detect if a sensor hasn't checked in for awhile.
How long should that be? (60 minutes?) Might as well make it configurable, add it to the Sensor model.
Create a cron script to poll for down sensors and send a notification to the alert group.
Ideas:
In the interest of being as lazy as possible, I made this work:
You can POST SensorData to the API using a GUID:
d = {
'guid': "ABCDEFGHIJKLMNOPQRSTUV",
'value': 43.0,
'key': 'FDEA9C52EBCA4F6D9B873FFF059F0392',
}
new_data_first_request = requests.post("http://localhost:9000/api/v1/data/", data=json.dumps(d), headers={'Content-type': 'application/json'})
d = {
'guid': "ABCDEFGHIJKLMNOPQRSTUV",
'value': 99.0,
'key': 'FDEA9C52EBCA4F6D9B873FFF059F0392',
}
new_data_second_request = requests.post("http://localhost:9000/api/v1/data/", data=json.dumps(d), headers={'Content-type': 'application/json'})
# First request response
# (Sensor with that GUID doesn't exist, create it, then associate SensorData to the newly created Sensor)
{u'state_changed': False, u'value': u'43.0',
u'datetime': u'2015-11-11T04:41:56.327317Z',
u'state': False, u'sensor': u'http://localhost:9000/api/v1/sensors/281/', u'id': 774}
# Second request response
# (Sensor exists with that GUID, associate SensorData to that Sensor)
{u'state_changed': False, u'value': u'99.0',
u'datetime': u'2015-11-11T04:41:56.33435Z',
u'state': False, u'sensor': u'http://localhost:9000/api/v1/sensors/281/', u'id': 775}
Not sure how documentation will all come together for the API, but figured I'd dump this here for now.
We're looking at mounting our thermonitor API under something like: https://sqrts.com/thermonitor/api/1/
We're using React and ahead-of-time transformation for the front end components, which means a few extra steps are required for the development and build processes. These all need to be documented.
create
methods for SensorSerializer
and SensorDataSerializer
in sensors/serializers.py
duplicates some code from signals and data models.
Fix is enroute... I'll write some tests to confirm things are still working as-is after removing the create() methods.
I think some of our datetime model fields are not configured for using UTC. Verify that we're using this consistently everywhere.
It looks like Austin did a good job of using datetime.nowutc() in the DRF API. I, however, did not while cooking up the models.
Django is setup to use sqlite3 out of the box. This needs to be changed to Postgresql when we go to production.
provision.sh
should also be taken into consideration and constants defined should make their way into our provision script to be repeatable.
Notifications branch still has some bugs and needs to be tested.
provision.sh
), and with it, a bower.json
manifest.thermonitor/static/img
templates/
Need IP/hostname of hoophouse router.
Austin and Dan will do this in the conference room glassboard
This (mostly) means data models but admin.py should also be built out a bit (and the admin app enabled!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.