Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PiHome – home automation done with Raspberry PI...

PiHome – home automation done with Raspberry PI and Python

Presented at PyWaw Summit in Warsaw

Wojciech Sznapka

May 26, 2015
Tweet

More Decks by Wojciech Sznapka

Other Decks in Programming

Transcript

  1. PiHome – home automation done with Raspberry PI and Python

    Wojciech Sznapka Head of Development @ Cherry Poland Twitter: @sznapka PyWaw Summit. Warsaw 2015
  2. Features • Steering (switches): – Floor heating steering (on /

    off / delayed) – Hot water pump steering – Lights • Sensors: – Current temperature – Draw charts • History: – switches state – temperatures
  3. Hardware • Raspberry PI B • Switches module (230V) controlled

    via Ethernet (ready-made board) • Dallas ds18b20 one wire temperature sensors • Bread-board and bunch of wires
  4. Software • Raspbian – with GPIO modules – Supervisord –

    Apache + WSGI • Pihome-api – Python – Flask – JSON • PiHome – AngularJS as a SPA frontend – Twitter Bootstrap – optimized for mobile – Grunt, Bower, Yeoman • CLI tasks – Queue consumers – Celery tasks
  5. Software • RabbitMQ – relay “store” requests (failover) • Celery

    - “delayed” on / off • MongoDB (hosted at compose.io) – history of sensors and switches • Memcached
  6. Future • Predict time when user wants to use hot

    water* • More switches (door, window blinds) • Connect to alarm to know where users are (PIR sensors) * Machine learning
  7. Lesson learned • Don't rely much on WiFi (have fallback

    / queue) • Don't play around with higher voltages unless you're pretty sure what're you doing... • Be prepared for frequent and random restarts • There plenty of ready made components, soldering is often last thing, if you want to get things fast