ESP8266's are Wemos Minis.
my IoT project is "A/C & Heat Zone Control". Basically, what I'm going to do is have ESP8266s in each of my rooms in my home. There will be another ESP8266 in the attic controlling 7 servos attached to the air handler. These servos are to be attached to the butter fly valves that control air flow to each room.
Each ESP8266 in the individual room, is using a Honeywell thermistor connected to the analog input on the ESP8266. There's some math to convert the resistance value to temp K, then convert to F. It then averages this over the course of 10 readings and outputs to a variable "averagetemp". I've tried the DHT11 and there isn't much resolution for what I wanted. So I went with a Honeywell thermistor (black tear drop type) and have been very happy with the accuracy and resolution of this. May try a DHT22 to see if the accuracy is better but right now the thermistor in my experience has been more accurate than the DHT11.
The ESP8266 in the attic will use the servo library to control 7 independent servos to open and close airflow to individual rooms.
Here's my requirement/vision for controlling the "system."
Each room will have 4 main "values"
averageTemp
openTemp
closeTemp
status
In the summer, open temp is the higher temperature at which the servo moves to open the valve and allow more air flow. The valve stays open until the close temp is reached, at which point the valve will close, limiting air flow.
I'd like the openTemp & closeTemp to be dynamic and able to be changed via a web page. This is where I'm struggling. I need a way for each ESP8266 to communicate to the "master" ESP8266 in the attic that controls the servos.
I have a Windows PC at home that has multiple functions. Plex media server, mySQL server, apache web server w/PHP, Samba server. I use this for media distribution inside and outside my home, as well as other home automation things not related to this project.
Avenues I've explored are:
Some form of basic communication: Maybe the easiest way, but would lose the ability to control a room's temperature with a webpage (and thus a mobile "app"). Each room's ESP8266 would have a basic webserver that writes a very simple page that would write the room's current temp. The ESP8266 in the attic would then read that page and look for the particular string (room name?) and then act based on that data. The downside is the openTemp and closeTemp wouldn't be adjustable as it would be hard coded into the ESP8266.
json file: Each room's ESP8266 will write to a specific json file (masterbedroom.json, guest1.json, livingroom.json) that will contain names:vaues for averageTemp,openTemp,closeTemp,status (if the valve is currently opened or closed). The ESP8266 in the attic will read each json file every X minutes and then move the servo if needed.
mySQL database: Have the room's ESP8266s write to a mySQL database. I think I prefer this route, as it would allow logging of the data to see if a particular room is running hotter than the others most of the time, if a particular room is "hunting" back and forth temp wise, etc etc. I really like this solution, but I'm having a hard time with implementation. All the example code out there for arduino and mySQL is using AT commands, not running arduino IDE natively on the ESP8266. I've seen some PHP file examples out there than can take a simple HTTP GET request and use that to write to a mySQL page.
MQTT I've only just started reading about this. Looks cool, but I know nothing about it. Same goes for ThingSpeak's API. I don't like this having to rely on a 3rd party website. If it goes down... I'm screwed. I'd really like for this to work within my home network, with my own hardware, however the features of ThingSpeak or AdaFruit's MQTT does look nice. I just haven't read much into it yet.
Unfortunately I know just enough about all of this to know that it's possible. With enough example code out there, I could get it to work. I'd like some guidance on which route would be the preferred, to achieve the main features I'm looking to have.
I hope this makes sense, and I sincerely appreciate any assistance given.