Code Monkey home page Code Monkey logo

espgrowlights's Introduction

espGrowLights

espGrowLights is an Arduino sketch for setting up a NodeMCU 1.0 (ESP-12E) to control the grow lights for our house plants.

Fritzing wiring diagram v1

Photo of espGrowLight-v2

To use this sketch you will need to copy config.sample.h to config.h and edit it for your wifi (these modules only support 2.4GHz). You may also want to change the device names in config.sample.h.

Usage

espGrowLights emulates two Belkin Wemo smart plugs that can be discovered by an Echo so long as they are on the same network. The first device is the builtin LED. The second controls both relays.

Alexa

To turn on the grow lights simply say "Alexa, turn on the disco lights." To trun on the on board led you can say "Alexa, turn on the esp led."

You may have noticed that I call the grow lights disco lights... thats because Alexa kept thinking I was saying "garage lights" when I actually said "grow lights." The lights have a bit of a disco feel and that is not similar to other words so it should keep her from getting cofused.

Button

There is also a momentary push button on the edge of the board that can be used to toggle the grow lights on or off. The code for this button includes logic to make it only respond about every 3 seconds after its first pressed. This is so that you don't end up rappidly turning the lights on and off multiple times. If you want to toggle the lights more than once you can either wait a moment or just hold the button down.

Auto on/off schedule

A schedule has also been incorporated into this so that our lights turn themselves on every morning and off every evening. The on and off hours are also in config.sample.h. Note that the off hour uses the 24-hour format. Lastly, note also that there are also settings for your timezone. I have included sample entries for UTC and US Eastern (with and without daylight savings).

Updates and troubleshooting

I've added mDNS so that you can verify the device is up by browsing to http://espGrowLights.local or pinging espGrowLights.local. That name corresponds to the HOST_NAME entry in config.sample.h. This page also acts as a sudo console that displays log messages. This allows for basic debugging withoug connecting to the serial port.

webserver screenshot

Note: the page automatically refreshes every 30 seconds.

Once the initial setup is done you can push updates OTA directly from the Arduino IDE without having to connect to it physically so long as you are on the same network.

Parts used

espgrowlights's People

Contributors

genebean avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.