Skip to content

castortut/activity-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

activity-api

Listens to messages published to an MQTT broker by motion sensors and provides an HTTP API to the data.

Configuration

The main file app.py has two configuration variables near the top:

HISTORY_LENGTH

Determines how many values per sensor ID to keep in memory and return to clients.

Example:

HISTORY_LENGTH = 5

ALIASES

Provides a mapping from the sensor IDs to more human friendly names for the sensors. The format is a dictionary with id: aliaspairs

Example:

ALIASES = {"123456": "First test sensor", "999999": "The second test sensor"}

MQTT_URL

URL to the MQTT broker that we want to subscribe to.

Example:

MQTT_URL = "mqtt.yourdomain.tld"

TODO

  • Log the values into a database instead of into memory in order to not loose data on restarts

  • Make the aliases configurable in a database instead of hard coding and requiring a new deployment to change

  • Make the MQTT_URL an environment variable instead of hard-coding it in the source code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages