Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphire committed Jun 11, 2022
1 parent 5716bc4 commit 8a682d8
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion ESP8266/HomeESP/HomeESP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool ConnectedToBroker = false;
bool Interupted = false;
bool lightSensorConnected = false;
bool LightState = false;
bool* KakuState = false;
bool* KakuState;
float Temperature;
float Humidity;
float LightIntensity;
Expand Down
Binary file added Images/alertcenter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/dashboard.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/deviceconfig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/deviceinfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/discoverytool.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/loginscreen.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/pinoutexample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 37 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# HomeESP
HomeESP is a simple home automation solution for the ESP8266, which allows you to monitor, control and configure compatible devices through a user friendly dashboard.
HomeESP is a simple standalone home automation solution using the ESP8266, it allows you to monitor, control and configure compatible devices through a user friendly dashboard.

This project is a proof-of-concept, as such, the sensors and actuators are not customizable in the dashboard. This project could however serve as a solid base for creating your own custom implementation to suit your own personal needs.
This project is a proof-of-concept, as such, there are some limitations. For example, the type of sensors and actuators and their pinouts are static and cannot be configured in the dashboard. However, if you have programming experience it should be quite easy to adapt and expand this project to suit your own needs.

![Dashboard](/Images/dashboard.jpeg)

## Dependencies
HomeESP requires the following libraries to be installed:
Expand All @@ -11,38 +13,40 @@ HomeESP requires the following libraries to be installed:
* [ArduinoJson 6.x](https://github.com/bblanchon/ArduinoJson)

HomeESP also makes use of the following libraries for the sensors and RF transmitter:
* [Newremoteswitch](https://bitbucket.org/fuzzillogic/433mhzforarduino/wiki/Home)
* [Newremoteswitch](https://github.com/1technophile/NewRemoteSwitch)
* [DHT](https://github.com/adafruit/DHT-sensor-library)
* [HP_bh1750](https://github.com/Starmbi/hp_BH1750)

In addition to those libraries, make sure that you have the ESP core files installed aswell:
* [ESP8266 Arduino Core](https://github.com/esp8266/Arduino)
* [ESP8266 Arduino Core](https://github.com/esp8266/Arduino) (Tested with v2.7.4)

## Installation & Setup
You can download HomeESP by clicking the green download button above, and then "Download ZIP". This zipfile contains the dashboard and HomeESP device firmware. You will need these files in a bit, but first we will need to setup an MQTT broker.

## Installation
### 1. MQTT Broker
Download and install an MQTT broker that supports websocket connections, such as mosquitto or hiveMQ.

Create login credentials for both yourself (Which will be used to login to the dashboard) and your devices.
Create login credentials for both yourself (Which will be used to login to the dashboard) and your devices (one login can be used for all devices), the exact way to do this varies depending on which broker you want to use.

Enable websockets in your broker configuration, as this is required for the dashboard to connect to the broker.
Enable websockets in your broker configuration and assign a port, this websocket port is required to login to the dashboard later. The devices will use the default MQTT port (usually 1883) for communicating with the MQTT broker.

NOTE: If you deploy the dashboard on an HTTPS server you must also use websockets with SSL, this means your MQTT broker needs an SSL certificate and be configured accordingly.
NOTE: If you deploy the dashboard on a webserver with HTTPS you must also use websockets with SSL, this means your MQTT broker needs an SSL certificate and be configured accordingly.

More info on how to install and setup your MQTT server can be found on their respective websites:
* [Mosquitto](https://mosquitto.org/)
* [HiveMQ](https://www.hivemq.com/)

### 2. Dashboard
Click the green download button above, next click "Download ZIP".

### 2. Getting The Dashboard Ready
**Installation for use on local machine:** <br>
Unzip the downloaded file and place the 'Dashboard' folder on your device, next open the index.html file inside to start.
Unzip the downloaded file and place the 'Dashboard' folder on your device, the dashboard can be opened by opening the index.html file.

**Installation for web deployment:** <br>
Unzip the downloaded file and place the contents of the dashboard folder in the root of your webserver, next simply navigate to your IP address or domain.

### 3. Connect Everything to Device
Connect all components to the ESP board. You can use [this webpage](https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/) as a pinout reference for your specific ESP board.
### 3. Connect Everything To The Device(s)
Time to connect all the components to the ESP board, a handy table with pinouts is shown below. The pinouts for the components are static, but all of the sensors and components are optional, meaning you can use a device with only a temperature/humidity sensor attached for example.

Tip: Use [this webpage](https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/) as a pinout reference for your specific ESP board.

Name | Type | Connected to GPIO
------------ | ------------- | -------------
Expand All @@ -53,36 +57,40 @@ Button | Input | 13
LED | Output | 12

Example with D1 Mini:
![D1 Mini](https://i.imgur.com/rtS2qYB.png)
![Pinout example](/Images/pinoutexample.png)

### 4. Install Device Firmware
Connect the ESP board to your computer.
### 4. Installing Device Firmware
**Note: It is recommended to use the [Arduino IDE](https://www.arduino.cc/en/software) for this step.**

Open the ESP8266 folder, and open the HomeESP.ino file inside with the Arduino IDE.
Connect the ESP board to your computer.

Make sure you have all of the required libraries, and the ESP8266 Arduino Core installed.
Navigate to the ESP8266 folder inside the HomeESP folder you just downloaded, and open the HomeESP.ino file inside with the Arduino IDE.

Select the correct board variant from Arduino IDE -> Tools -> Board.

Click Upload.
Click the upload button, it should now start compiling and uploading. Keep an eye on the console output to make sure this happened correctly. If it fails, check whether you have all of the required libraries, the ESP8266 Arduino Core installed (Tested with v2.7.4) and selected the correct board type.

### 5. Device Setup
Once the upload is complete, press the button that is connected to GPIO 13 of the device. The device will now enter a broadcast mode, which allows you to connect to your device directly via wifi. Look for any open network with the name "HomeESP" followed by 4 random numbers, and connect to it.
### 5. Device Configuration
Once the upload is complete, wait a few seconds and press the button that is connected to GPIO 13 of the device. The device will now enter a broadcast mode, which allows you to connect to your device directly via wifi. Look for any open network with the name "HomeESP" followed by 4 random numbers, and connect to it.

Next, open your webbrowser and navigate to the device configuration page: [http://192.168.1.1/config](http://192.168.1.1/config).
Next, open your webbrowser and navigate to the device configuration page: [http://192.168.1.1/config](http://192.168.1.1/config). It should look something like this:

Lastly, enter the desired hostname, network info and MQTT broker logindetails for your device and click save.
![Device Setup](/Images/deviceconfig.png)

Your device should now automatically restart, and connect to your network and MQTT broker.
Here you can enter the desired hostname for the device, network info (Wifi SSID & password) and the MQTT username and password for your device, the MQTT port can be left at 1883 (which is the default for most MQTT brokers).

### 6. Done!
Click save, your device should now automatically restart and connect to your network and MQTT broker.

### 6. Logging Into The Dashboard
Open the dashboard and enter the login details that you created in step 1.

Enter the hostname of your broker and the websocket port that you configured in step 1 and click login.
Enter the hostname of your mqtt broker and the websocket port that you configured in step 1 and click login.

Once you succesfully login you should be greeted with the discovery tool, this allows you to quickly add any devices that are currently connected to the MQTT broker, if your device does not show up right away you can press the green refresh button. Select all of the devices that you would like to add and click 'Add selected devices'.

Once you succesfully login you should be greeted with the discovery tool, this allows you to quickly add any devices that are currently connected to the MQTT broker, if your device does not show up right away you can press the green refresh button.
![Device Discovery Tool](/Images/discoverytool.jpeg)

Next, simply select all of the devices that you would like to add and click 'Add selected devices'.
Done! Your devices should now show up on the dashboard!

## HomeESP Protocol (V2.1)
The HomeESP dashboard and devices use the MQTT protocol (A lightweight publish/subscribe protocol) to communicate with one another. MQTT clients communicate by subscribing and publishing messages to specific topics, which may also contain a payload. All topics used by HomeESP are laid out in the table below.
Expand Down

0 comments on commit 8a682d8

Please sign in to comment.