Welcome to that huge Object-Oriented Arduino Sketch.
It is the elementary part of my home automation setup. I use it to control my wireless power sockets.
- Some esp8266 (ESP-12E) board
- FS1000A 433MHz transmitter
- Two normal LEDs (Rx/Tx activity)
- Four resistors, some wires...
The wiring is rather straightforward:
While booting, the board loads the configuration stored in SPIFFS or it will create one with default settings.
It uses the config, to know which wifi to join. There it announces
the included web server (e.g.
device.local) via MDNS.
Visiting that webpage one may control the configured wireless power sockets and the included RGB-LED (now with fancy RGB value sliders).
The included shell waiting on the serial can be used to..
- change the configuration, store to or (re-)load from flash.
- dial or hangup wifi
- control power and/or led
- show statistics
But it is also possible to talk to the api directly, receiving a json response:
Fade LED to red:
Flash LED in green:
Fade LED to some random color:
255), or in hex prefixed it with the
Switch sockets on and off by raw address:
curl device.local/power/full/0110100100 curl device.local/power/null/0110100100
01101, switch =
Switch sockets by configured name: