-->
Page 1 of 1

questions before start home automation

PostPosted: Thu Dec 04, 2014 7:52 am
by juanmol
Hi all,
i think i can use esp8266 esp-01 to control a light without a mcu. I need:
1- a gpio to control a relay (gpio13)
2- a gpio to read from the switch (gpio2)
3- send the swith state on each swith change (get http://server.ip:8080/light1/on), and change the relay state.
4- receive new orders, to control the relay

It's possible all that only with the esp-01? I have read the webserver tutorial, i think this is very simmilar. What i have on my mind:

## mental code start
on start{
set gpio13=LOW
set STATUS=LOW}

on loop{
if gpio2 state = HIGH and STATUS=LOW (
set gpio13=HIGH
set STATUS=HIGH
get http://server.ip:8080/light1/on
)
if gpio2 state = HIGH and STATUS=HIGH (
set gpio13=LOW
set STATUS=LOW
get http://server.ip:8080/light1/off
)
if [[wifi received]] = ligh1/on (
set gpio13=HIGH
set STATUS=HIGH
get http://server.ip:8080/light1/on
)
if [[wifi received]] = ligh1/off (
set gpio13=LOW
set STATUS=LOW
get http://server.ip:8080/light1/off
)

}
## mental code end

it's possible? can anyone guide me?

Re: questions before start home automation

PostPosted: Mon Jan 05, 2015 2:27 am
by balonio
I am also interest in doing the same thing, I am waiting for my esp 01 and some relays. Have you had any prigress?

Re: questions before start home automation

PostPosted: Sat Feb 07, 2015 2:19 pm
by jpe
I am in the same starting position and this seems to be a simple place to begin from.
How have you made out with this?