Home automation play ground.
This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2016-02-01 16:07:55 +01:00
arduino more arduino-like code 2016-01-30 19:06:14 +01:00
nodejs start rc_db model 2016-02-01 16:07:55 +01:00
.gitignore add config js 2016-02-01 15:34:05 +01:00
.gitmodules add ir library submodule 2016-01-21 17:43:16 +01:00
README.md add config js 2016-02-01 15:34:05 +01:00

Home Automation

Vision

This should work in such a way that the user logs into a web interface where they then should be able to easily control their home. A lot like heimcontrol.js, however with a cleaner interface and less wasted space. On the technical side it would be nice to have a better protocol than the one used by duino, which seems counterintuitive. Its not a binary protocol, but rather a text based one, which is odd. It would also be nice if there were a easier way to set up device maybe I could use receivers to learn patterns of, for example IR-remotes, that I then could replicate with the transmitter. It would also be nice to have the capability to schedule tasks. Turning on the radio to wake me up or being able to switch of the lights automatically for example.

Dependicies and Requirements

Hardware

  • Raspberry Pi
  • Arduino Uno Rev3
  • Heat-Sensor
  • Light-Sensor
  • RC-Transmitter (Receiver?)
  • IR-Transmitter
  • IR-Receiver
  • RC-Poweroutlets
  • LEDs

Software

Pins

Analog

Pin Function
A0 Temperature
A1 Light

Digital

Pin Function
~3* IR-Trasmitter
~10* IR-Receiver
~11 RC-Trasmitter
~13* LED (Status)

The pins marked with an * are fixed and cannot be changed to another pin.

Protocol

0,5 Byte Overhead
0,5 Byte Command
1 Byte Pin
6 Byte Value
----
8 Byte

Description

All messages start with the header, which consits of a nibble:

0101

Those four Bits are followed by one of ten commands which are also encoded in a nibble i.e.:

0000 - toggle Debug mode
or combined
0101 0000 - Ascii: P / Dec: 80

The server side of the protocol deals with the messages as Ascii encoded strings. This is followed by the second byte which encodes the pin that shall be used:

Pin ranges digital: 110 0001 / Ascii: a / DEC: 97  - 110 1110 / Ascii: n / DEC: 110
Pin ranges analog:  110 1111 / Ascii: o / DEC: 111 - 111 0100 / Ascii: t / DEC: 116

Followed by six byte long value

Possible Commands

  • 80 - P - toggle Debug
  • 81 - Q - set pin mode
  • 82 - R - digital write
  • 83 - S - digital read
  • 84 - T - analog write
  • 85 - U - analog read
  • 86 - V - handle RC Decimal
  • 87 - W - handle RC TriState
  • 88 - X - handle IR send
  • 89 - Y - handle IR read

Special Command

  • 90 - Z - Beginn Communication

Possible future commands

  • 91 - [ -
  • 92 - \ -
  • 93 - ] -
  • 94 - ^ -
  • 95 - _ -