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

PiHome – home automation done with Raspberry PI and Python

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

    View Slide

  2. View Slide

  3. Features

    Steering (switches):
    – Floor heating steering (on / off / delayed)
    – Hot water pump steering
    – Lights

    Sensors:
    – Current temperature
    – Draw charts

    History:
    – switches state
    – temperatures

    View Slide

  4. 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

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. 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

    View Slide

  9. Software

    RabbitMQ – relay “store” requests (failover)

    Celery - “delayed” on / off

    MongoDB (hosted at compose.io) – history of
    sensors and switches

    Memcached

    View Slide

  10. View Slide

  11. 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

    View Slide

  12. 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

    View Slide

  13. Thanks :-)
    https://github.com/wowo/pihome
    https://github.com/wowo/pihome-api
    [email protected]

    View Slide