Flexible modular non-blocking system for controlling ESP8266. You can reconfigure the system based on how you plug PINs. You can turn on/off modules which are not used. Configuration of current module is store in JSON file.
More information about the project:
- LampAndroidApp - https://github.com/georgik/LampAndroidApp - application which allows remot control of relay
Over the air update - OTA
Push new version to device over WiFi.
Connects to MQTT broker - send status and receive commands.
Simple web interface which display's current status of module and let you configure whole system. You can also change the state of relay.
Available configuration options:
mqtt_host- server host with Mosquitto or other MQTT broker
mqtt_port- server port with Mosquitto
mqtt_parent_topic- all topics for the devices will be published/subscribed under this topic (e.g. "/home")
hostname- device name used for publishing topics (e.g. "bathroom")
temperature_correction- correction which should be added to value measured by temperature sensor (e.g. -1.2)
photocell_threshold- value which is considered by photocell as light between 0 and 1023 (e.g. 200)
pir_up_interval- number of seconds when PIR is considered up after the first HIGH state
Start Config Portal when device is not able to connect to WiFi. Access 192.168.4.1 IP to configure the device.
Recommendation: Use PlatformIO for development.
You can turn on/off modules from code in LampMain. Each module has setup function which takes two parameters or more:
Further configuration could be done via REST API and request to config page.
Air quality sensor
Read value from analog and send it to server.
Meassure temperature and humidity.
Detect motion and change state of on-board led.
Receive MQTT command and change state of relay.
RGB LED indicates detection of motion based on PIR. If no motion was detected then it counts down and display further colors.
RGB LED could be controlled via MQTT message sent to topic /parent/host/command.
off to turn the LED off.
Water Level Sensor
Indicate whether water was dete/restartcted by sensor
Intorduced modular architecture. User can configure functionality in top-level code.
Configuration is stored in config.json and managed by WiFiManager.
Direct communication based on GET API, MQTT and OTA support. See branch v0.1.