Code Monkey home page Code Monkey logo

pycalima's Introduction

PyCalima

Simple python interface against the Pax Calima® bathroom fan created and sold by Pax®

This module provides a very simple interface against the various GATT characteristics of the Calima fan, most importantly it handles the authentication so values are actually persisted within the fan.

Uses BluePy

Installation

I did this on Raspberry Pi Zero W but it can be done on any computer which support BluePy (and has a bluetooth dongle).

You will need to install python3 which is Python v 3.4 if you install it from apt-get repos.
$apt install python3 python3-pip libglib2.0-dev
Then install BluePy
$sudo pip3 install bluepy

Clone this repo and then user run.py script to set the basic settings for your Calima. They will be applied if Calima was power cycled. Afterwards it will just poll Calima and output the data. You can pipe it to your home autmation scripts or or cronjob it to a file.

Demo usage

from Calima import Calima

fan = Calima("MA:CC:AD:DR:ES:SS", "012345")
print(fan.getAlias())

Command line tool

Pretty useful command line tool which among other things can print all the characteristics of a fan. It can also search for available fans if you don't know the MAC address.

For more on using the tool, just run calima -h.

Debugging

Set this to True in pycalima/Calima.py file if want to see more verbose output.

self._debug = False

Documentation

A good readup introductory readup on BLE reverse engineering can be found here.

Some badly structured details about the protocol can be found in the Characteristics file.

There is currently no documentation on the module yet, check the Calima.py file to see available functions.

License

See LICENSE file

pycalima's People

Contributors

patricke94 avatar bortek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.