Skip to content
robintemmePublic

About

Flask API on a Raspberry Pi that moved the blinds in my flat, one serial byte per endpoint (2015)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

RollAPI

The HTTP API that moved the blinds in my flat. Started February 2015.

A Flask app on a Raspberry Pi. Every endpoint does the same thing: write one byte to /dev/ttyAMA0 at 57600 baud and let the controller wired to the blind motors work out the rest.

Endpoint Byte
POST /all/up / POST /all/down 1 / 2
POST /door/up / POST /door/down 3 / 4
POST /window/up / POST /window/down 5 / 6
POST /stop 0

GET /dht reads a DHT11 on GPIO 24 and returns temperature and humidity. It supports JSONP, because in 2015 that was how you got a number into a page you did not control.

What became of it

The last commit here is "Fix /dht format for use with homebridge" — by then this had a HomeKit front end. That part grew up and left:

  • homebridge-blinds began as the Homebridge plugin for these endpoints in August 2016. It is on v3, speaks MQTT and REST, and is still maintained today by @dxdc.
  • hkblinds is the same idea as a standalone HomeKit accessory in Go.
  • BellPi is the front door of the same flat.

Running it

Python 2, flask, pyserial, Adafruit_DHT, and a Pi with the serial port free. python main.py listens on :54321.

Left exactly as it was: debug mode on, no authentication, bound to 0.0.0.0. It lived on a home network behind a door that was already locked. Do not copy that part.

About

Flask API on a Raspberry Pi that moved the blinds in my flat, one serial byte per endpoint (2015)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages