Coder Social home page Coder Social logo

smart_remote's Introduction

Smart Remote

This an Esp8266 Wifi module code to turn on or off Devices by using Smart Remote app. \n you can download the app from here : https://play.google.com/store/apps/details?id=com.basemosama.smarthome

Esp8266 Setup

The example Esp8266 code uses Arduino to program the Wifi Module .
you will need to setup arduino to use the example. you can follow the instructions in the link below
https://github.com/esp8266/Arduino

Libraries

You will have to install these libraries

For More Informations on how to install the libraries you can follow this guide

https://www.arduino.cc/en/Guide/Libraries

Setup

You should add your Wifi SSID and Pasword on the arduino code .
Then You should get the ip address of the Esp8266 Wifi Module after running the code.
and then update the app ip address on the app settings.

How it Work

First the Esp8266 will create a local server that we will use to communicate with the app. for each device it will be represtende in json and has the following properties :(id - name - status - pin) The server has 3 main routes we can use by sending POST requests and data will be sent and recived in json

GET /

will show a Hello World message to show that the server is working
POST /status

Body json( json array of devices : ) like:
[
   {
      "id":1,
      "name":"led",
      "pin":0,
      "status":true
   },
   {
      "id":2,
      "name":"tv",
      "pin":0,
      "status":false
   },
   {
      "id":3,
      "name":"Pc",
      "pin":0,
      "status":true
   }
]

this method is responsible of changing the state of each device depending on the status of each device sent in the body of the request

POST /timer Body json( json array of devices : ) like above
Response :
[
   {
      "id":1,
      "name":"led",
      "pin":0,
      "status":true,
	  "time":756,  
	  "timeText":"22:45",
	 "timerId":1
   },
   {
      "id":2,
      "name":"tv",
      "pin":0,
      "status":false
   },
   {
      "id":3,
      "name":"Pc",
      "pin":0,
      "status":true
   }
]

this method will set a timer for certain duration for each device that has a time value it will make the Esp8266 change the state of the device after this duration

POST /sync  Body json( json array of devices : ) like previous requests

this will update the status of each device base on there pins and return back the devices with the updated state.

Features of The app

You can turn on and off any device that connected to Esp8266 .
Setting timer to turn on and off any of your devices .
Turn On and Off all your devices with just one click.
Add timer to Turn On and Off a device or all your devices.

ScreenShots

Home Screen Adding Device Editing Device Adding Timer Active Timers Settings

smart_remote's People

Contributors

basemosama avatar

Stargazers

Tiago avatar  avatar Chilung Chan avatar  avatar  avatar Atisit Naknawa avatar  avatar

Watchers

 avatar

smart_remote's Issues

android app

would you mind to make android part open source?

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.