Skip to content

Make your own - Harmony hub like - hub with ESP8266. Firmware for smart home controller for ESP8266. It can controll wirelless (433MHz) sockets, home devices like tv, radio, and othes via IR, controll lights/send info by/from motion sensor, and others.

License

Notifications You must be signed in to change notification settings

borisgrigorov/Smart-home-controller

Repository files navigation

Smart home controller (AKA Smart home mini)

Make your own - Harmony hub like - hub with esp8266. Smart home controller firmware for ESP8266 for controlling smart sockets, switch, tvs, radios, projectors, lights, and others. It works with Node-RED, Openhab, or anything you configure it for.

Features

  • Control devices via 433Mhz module
  • Control devices via IR
  • Send motion info
  • Send button press
  • Auto switch to access point mode, when not connected to wifi
  • (OTA update)*
  • (Measure temperature)*
  • (Receive 433Mhz data)*
  • (Generate own firmware from GUI)*

*In progress

Requirements

  • Installed support for boards with esp - Tutorial
  • PubSubClient library - Link
  • RCSwitch library- In source
  • Wifi Manager library - Link

How to use

  1. Install libraries (Put them in libraries folder in Arduino sketches)
  2. Clone repo or download .zip
  3. (Optional) Get the IR and 433Mhz codes.
  4. Connect all things you want to use to the board.
  5. Change code for what you want to use - change pins for your connection, and change parameters like mqtt brokers address and port, or mqtt messages. You can change anything you want.
  6. Upload code from Arduino IDE.
  7. Enjoy :-)

Get codes

433MHz codes

  1. Connect 433Mhz receive module to Arduino, NodeMCU, or something like that to GPIO 2. (Or change the pin in sketch)
  2. Upload the code for catching codes. (receivers/RF_receive.ino)
  3. Open serial monitor.
  4. Take the original remote of the sockets, or what you want to control
  5. Use the function you want to record.
  6. In the serial monitor will show the codes.
  7. Write somewhere the name of function, binary code, pulse length and protocol.
  8. In Smart_Home_Controller.ino file in callback function set this mySwitch.send("10011000111000110000111111110100"); (change the binaries to yours), on the message you want to.
  9. Repeat this for every function you want to record.

IR codes

  1. Connect IR receiver to Arduino, NodeMCU, or something like that to GPIO 2. Or change the pin in sketch
  2. Upload the code. Upload the code for catching codes. (receivers/IR_receive.ino)
  3. Open serial monitor.
  4. Take the remote of device you want to control.
  5. Use the function you want to record.
  6. In the serial monitor will show the codes.
  7. There are two methods:

1. Easy way using Python

  1. Copy all of these codes.
  2. Save it to file named ir.txt in the folder where is Ir_codes_writer.py.
  3. Run the Python script. (You must have installed python on your PC)
  4. Open generated done.txt file
  5. Copy all content
  6. In the file ir_commands.h create function called whatever you want.
  7. In the function body paste the generated content.
  8. In Smart_Home_Controller.ino file in callback function set this function on the message you want to.

2. Hard way using manual copy&paste

  1. In the file ir_commands.h create function called whatever you want.
  2. In the function body write this function delayMicroseconds(40152); !Change the number to your number from left column!
  3. In the function body write this function pulseIR(3060); !Change the number to your number from right column!
  4. Repeat this for every row
  5. In Smart_Home_Controller.ino file in callback function set this function on the message you want to.

About

Make your own - Harmony hub like - hub with ESP8266. Firmware for smart home controller for ESP8266. It can controll wirelless (433MHz) sockets, home devices like tv, radio, and othes via IR, controll lights/send info by/from motion sensor, and others.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published