Computherm Q7 RF thermostat button pusher 3d model
3dmdb logo
Thingiverse
Computherm Q7 RF thermostat button pusher

Computherm Q7 RF thermostat button pusher

by Thingiverse
Last crawled date: 4 years, 2 months ago
If you set the temperature to HOLD, then simply can unlock it by pressing the SET button in the thermostat, This mechanisam, helps you to push button from everywere, via MQTT protocol, by Adafruit.
https://youtu.be/h-JX-WLHZMI
Control your wireless termostat via Adafruit MQTT.
Only need one esp 8266, one dht 11 sensor, and one SG90 servo
What Need to change in the source :
define WIFI_SSID "YOUR WIFI SSID"
define WIFI_PASS "YOUR WIFI PASS"
define MQTT_NAME "YOUR MQTT USER"
define MQTT_PASS "YOUR MQTT PASS"
Sorce to Arduino :
include
include "Adafruit_MQTT.h"
include "Adafruit_MQTT_Client.h"
include
include
Servo servo;
int angle = 0; // servo position in degrees
int servoPin = 14;
include "DHT.h"
define DHTPIN 2
define DHTTYPE DHT11
define WIFI_SSID "YOUR WIFI SSID"
define WIFI_PASS "YOUR WIFI PASS"
define MQTT_SERV "io.adafruit.com"
define MQTT_PORT 1883
define MQTT_NAME "YOUR MQTT USER"
define MQTT_PASS "YOUR MQTT PASS"
DHT dht(DHTPIN, DHTTYPE);
//Set up MQTT and WiFi clients
WiFiClient client;
Adafruit_MQTT_Client mqtt(&client, MQTT_SERV, MQTT_PORT, MQTT_NAME, MQTT_PASS);
//Set up the feed you're subscribing to
Adafruit_MQTT_Subscribe onoff = Adafruit_MQTT_Subscribe(&mqtt, MQTT_NAME "/feeds/onoff");
Adafruit_MQTT_Publish temperature = Adafruit_MQTT_Publish(&mqtt, MQTT_NAME "/feeds/temperature");
Adafruit_MQTT_Publish humidity = Adafruit_MQTT_Publish(&mqtt, MQTT_NAME "/feeds/humidity");
void setup()
{
Serial.begin(9600);
//Connect to WiFi
Serial.print("\n\nConnecting Wifi... ");
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
}
Serial.println("OK!");
//Subscribe to the onoff feed
mqtt.subscribe(&onoff);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
// Setup feeds for temperature & humidity
dht.begin();
servo.attach(servoPin);
servo.write(0);
delay(300);
servo.write(10);
delay(300);
servo.write(60);
}
void loop()
{
MQTT_connect();
//Read from our subscription queue until we run out, or
//wait up to 5 seconds for subscription to update
Adafruit_MQTT_Subscribe subscription;
while ((subscription = mqtt.readSubscription(5000)))
{
//If we're in here, a subscription updated...
if (subscription == &onoff)
{
//Print the new value to the serial monitor
Serial.print("onoff: ");
Serial.println((char) onoff.lastread);
//If the new value is "ON", turn the light on.
//Otherwise, turn it off.
if (!strcmp((char*) onoff.lastread, "ON"))
{
//Active low logic
digitalWrite(LED_BUILTIN, LOW);
servo.write(0);
delay(1000);
servo.write(60);
}
else
{
digitalWrite(LED_BUILTIN, HIGH);
}
}
}
// ping the server to keep the mqtt connection alive
if (!mqtt.ping())
{
mqtt.disconnect();
}
int humidity_data = (int)dht.readHumidity();
int temperature_data = (int)dht.readTemperature();
temperature.publish(temperature_data);
humidity.publish(humidity_data);
delay(100);
}
/***
Adafruit MQTT Library ESP8266 Example
Must use ESP8266 Arduino from:https://github.com/esp8266/Arduino
Works great with Adafruit's Huzzah ESP board & Feather
----> https://www.adafruit.com/product/2471
----> https://www.adafruit.com/products/2821
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Tony DiCola for Adafruit Industries.
MIT license, all text above must be included in any redistribution****/
void MQTT_connect()
{
int8_t ret;
// Stop if already connected.
if (mqtt.connected())
{
return;
}
Serial.print("Connecting to MQTT... ");
uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) // connect will return 0 for connected
{
Serial.println(mqtt.connectErrorString(ret));
Serial.println("Retrying MQTT connection in 5 seconds...");
mqtt.disconnect();
delay(5000); // wait 5 seconds
retries--;
if (retries == 0)
{
// basically die and wait for WDT to reset me
while (1);
}
}
Serial.println("MQTT Connected!");
}

Tags