All Projects → TomFaulkner → Senseme

TomFaulkner / Senseme

Licence: gpl-3.0
Python Library for Haiku SenseMe app controlled fans/lights

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Senseme

Pyatv
A python client library for the Apple TV
Stars: ✭ 322 (+1594.74%)
Mutual labels:  home-automation, hacktoberfest
Quiche
🥧 Savoury implementation of the QUIC transport protocol and HTTP/3
Stars: ✭ 5,481 (+28747.37%)
Mutual labels:  hacktoberfest, protocol
Home Assistantconfig
🏠 Home Assistant configuration & Documentation for my Smart House. Write-ups, videos, part lists, and links throughout. Be sure to ⭐ it. Updated FREQUENTLY!
Stars: ✭ 3,687 (+19305.26%)
Mutual labels:  home-automation, hacktoberfest
Awesome Home Assistant
A curated list of amazingly awesome Home Assistant resources.
Stars: ✭ 3,487 (+18252.63%)
Mutual labels:  home-automation, hacktoberfest
H1st
The AI Application Platform We All Need. Human AND Machine Intelligence. Based on experience building AI solutions at Panasonic: robotics predictive maintenance, cold-chain energy optimization, Gigafactory battery mfg, avionics, automotive cybersecurity, and more.
Stars: ✭ 697 (+3568.42%)
Mutual labels:  home-automation, hacktoberfest
Freki
🐺 Malware analysis platform
Stars: ✭ 285 (+1400%)
Mutual labels:  hacktoberfest, flask
Cookiecutter Flask
A flask template with Bootstrap 4, asset bundling+minification with webpack, starter templates, and registration/authentication. For use with cookiecutter.
Stars: ✭ 3,967 (+20778.95%)
Mutual labels:  hacktoberfest, flask
Blinkpy
A Python library for the Blink Camera system
Stars: ✭ 174 (+815.79%)
Mutual labels:  home-automation, hacktoberfest
Ios
📱 Home Assistant for Apple platforms
Stars: ✭ 667 (+3410.53%)
Mutual labels:  home-automation, hacktoberfest
Flask Empty
An empty project skeleton / boilerplate for flask projects. Powered by CookieCutter.
Stars: ✭ 569 (+2894.74%)
Mutual labels:  hacktoberfest, flask
awesome-ha-blueprints
A curated collection of automation blueprints for Home Assistant.
Stars: ✭ 258 (+1257.89%)
Mutual labels:  light, home-automation
Room Assistant
Presence tracking and more for automation on the room-level
Stars: ✭ 764 (+3921.05%)
Mutual labels:  home-automation, hacktoberfest
Node Red Contrib Home Assistant Websocket
Node-RED integration with Home Assistant Core
Stars: ✭ 222 (+1068.42%)
Mutual labels:  home-automation, hacktoberfest
Esphome
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Stars: ✭ 4,324 (+22657.89%)
Mutual labels:  home-automation, hacktoberfest
Home Panel
A web frontend for controlling the home.
Stars: ✭ 185 (+873.68%)
Mutual labels:  home-automation, hacktoberfest
Freedomotic
Open IoT Framework
Stars: ✭ 354 (+1763.16%)
Mutual labels:  home-automation, hacktoberfest
Ha Dockermon
A NodeJS RESTful API which can be used with Home Assistant to report the state of Docker Containers
Stars: ✭ 171 (+800%)
Mutual labels:  home-automation, hacktoberfest
Naomi
The Naomi Project is an open source, technology agnostic platform for developing always-on, voice-controlled applications!
Stars: ✭ 171 (+800%)
Mutual labels:  home-automation, hacktoberfest
Flask Googlemaps
Easy way to add GoogleMaps to Flask applications. maintainer: @RiverFount
Stars: ✭ 550 (+2794.74%)
Mutual labels:  hacktoberfest, flask
Yacht
A web interface for managing docker containers with an emphasis on templating to provide 1 click deployments. Think of it like a decentralized app store for servers that anyone can make packages for.
Stars: ✭ 712 (+3647.37%)
Mutual labels:  hacktoberfest, flask

Code style: black

SenseMe

Python Library for Haiku SenseMe app controlled fans/lights

This library is useful to control Haiku SenseMe fans with light kits. I would expect it will probably also work with their lights.

It might also be useful for controlling DIY projects as the protocol is very simple and would be easy to clone. And, if you were to use their API the Android and iOS apps may work to control DIY devices. A suggested idea would be to add an Arduino or Raspberry Pi and a relay or two to your own fan and use this or the Haiku Home app to control them. I've read that doing this sort of thing with a resistor is a dangerous idea, so don't do that.

Sniffing the packets and documenting the protocol were the work of Bruce. Much of the code was based on his work on making an Indigo plugin

See Issues for known issues or if you want to contribute but don't know where to start. Some easy fixes are labeled.

I am not affiliated with Haiku Home or Big Ass Fans. Their support rep said this project seemed cool in it's infancy, and they even answered a technical question regarding the protocol for me, so hopefully they still approve.

Future

Some ideas for future related projects and features:

  1. Plex plugin (dim the fans when the movie starts and light up when it is paused or ends? Yes, please!)

  2. Alexa / Google Home plugins (see REST API below)

  3. Store information in a database (sqlite, or even json, would be fine) rather than discovering each time.

  4. Track usage and temperatures

  5. Other automation system plugins

  6. REST API backend with a CLI client (a basic direct to fan command line client was added in 0.1.3)

  7. React or other web based client for the above API

  8. Docker image for the above

  9. Use protocol to control other devices by attaching an Arduino or Pi

  10. Discover the rest of the protocol. (Run strings on the apps and some packet sniffing.)

  11. More examples

  12. Command Line Client Basic client added in 0.1.3, see SenseMe CLI below

  13. Unit Tests

Usage

from senseme import discover
# discover devices, returns list of SenseMe devices
devices = discover()
fan = devices[0]
repr(fan)

SenseMe(name='Living Room Fan', ip='192.168.1.50', model='FAN,HAIKU', series='HSERIES', mac='20:F8:5E:E3:AB:00')

# Statically assign the fan? Probably not, but you would do it this way:
from senseme import SenseMe
fan = SenseMe('192.168.1.50', 'Living Room Fan', model='FAN')
# or, this might be easier
fan = SenseMe(name="Living Room Fan")

Control the fan:

# Turn the light off / on
fan.light_powered_on = False
fan.light_powered_on = True
# or, if you just want to toggle it
light_status = fan.light_toggle()

# Increase light level by 2 levels
fan.inc_brightness(2)

# Get Light level
print(fan.brightness)

# Fan Speeds
fan.fan_powered_on = True
fan.fan_powered_on = False
print(fan.speed)

# whoosh mode
fan.whoosh = True

# want an increasing light effect? Do this.
# But, really, probably don't, I don't think Haiku intended strobe effects.
# I'm not responsible if you make a strobe light and break the fan or worse
for intensity in range(1,16):
    fan.brightness = intensity
    time.sleep(1)

# export details to json / xml / str (as `str(dict)`)
fan.json
fan.xml
fan.dict  # nested dict
fan.flat_dict  # flattened

# Listen for broadcasts, useful for debugging,
# wouldn't suggest using it for anything else
fan.listen()

SenseMe CLI

In version 0.1.3 a script was added to control HaikuHome SenseMe devices from a command line.

Set the following environment variables:

SENSEME_DEFAULT_FAN_IP
SENSEME_DEFAULT_FAN_NAME

Then run senseme_cli with one of the following options.

fan x           - set speed to x (0-7)
fan on|off      - fan on/off
light x         - set light brightness to x
light on|off    - light on/off
whoosh [on|off] - whoosh mode on/off

Requirements

Python 3.6 is required to use this library. SenseMe devices communicate on UDP port 31415 using broadcast and unicast traffic. Any firewall will have to allow this through.

Concurrent fan control and real-time data collecting

Mike Lawrence made a fork that improves upon some of the limitations in this library and makes use of concurrency to talk to multiple devices simultaneously. I haven't use his library, but it looks promising.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].