Git Product home page Git Product logo

fan_controller's Introduction

fan_controller

Python prototype to control ceiling fan ( H52-5B ) through 315Mhz transmitter

Recorded from remote with FCC ID: A25-TX005R

Tranmission parameters

  • Modulation: ASK
  • Pulse Width: 450ms
  • Coding: NRZ
  • Zeros and ones have equal pulse width. GPIO set to high for 405ms means 1, while GPIO set to low for 450 ms means 0.

Protocol

Every messages remotes sends 5 times, with pause between message 850us.

Every message has remote ID + command + ending:

  • Remote ID is unique 6 bytes identifier every remote has. Fan learn this identifier during pairing session.
  • Command is an actual command for the fan. See table below
  • Ending is 9 bits 0b001011001. They are always the same in every message.

Commands

Action Code
Pair remote 0x9659
High Speed 0x92db
Medium speed 0xb2db
Low Speed 0x96db
Turn off fan 0xb6cb
Toggle light on/off 0x92cb

Remote ID

Can be any value between 0x71231248b85b and 0x136db2c96592b, including these values. Maybe range even bigger, but I don't want to spend time finding precise ranges. I can confirm that 0xFFFFFFFFFFFF doesn't work as well as 0xb6db2c96592c.

Example

Let's assume you have fan you paired earlier with remote ID 0x96d97db34b24. Then to send a command to toggle light you send 0x96d97db34b24 + 0x92cb + 0b001011001. Which in binary format will be 0b1001011011011001011111011011001101001011001001001001001011001011001011001

RUN

poetry run main will start http server, first add an remote by calling 'curl -XPOST -H'Content-Type: application/json' http://172.17.0.1:8081/new/remote -d'{"remote_name":"befroom_fan","remote_id":"0X00000000000"}'. You can add few different remotes. After you added remotes, you can send them commands(see protocol.py) for example curl -XPOST http://172.17.0.1:8081/command/bedroom_fan/light_toggle

fan_controller's People

Contributors

anlorn avatar

Watchers

 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.