Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tests
.gitignore
README.md
config.py
fabfile.py
main.py
metricfire.py

README.md

Python DigiTemp Metricfire connector

This program queries temperature sensors and upload the data to metricfire via its python API. It will run until terminated by ctrl-c. Alternatively have a look at the --once and --quiet command line switches to run under cron.

Requirements

  • You need to have [Digitemp] installed and working.
  • To run the included unit tests, you need [Fabric] installed.

Building the sensors

I've written a blog post tutorial on how to solder suitable DS18S20 sensors to the serial port of a computer. Also there is this tutorial which I found most useful.

Configuration

The various runtime parameters are set in config.py. The api-key can also be specified in an own file. The various configuration parameters are documented in config.py itself.

Supported command line switches:

  • --once : Run only once and exit after uploading the data.
  • --quiet : Don't output anything below ERROR level.

Running with cron

The following line can be entered into your crontab (hint: run crontab -e) and will have cron call the script once per minute. Errors during execution will show up in your syslog and will usually be sent to you via email.

* * * * * cd PATH_WHERE_YOU_CHECKED_OUT; ./main.py --quiet --once;

Unittests

You can run the included unit tests, by calling fab test in the top level directory. However you need mock version >= 0.8 for the tests to run.

Something went wrong with that request. Please try again.