-
Notifications
You must be signed in to change notification settings - Fork 0
/
ALEXA_IOT.ino
65 lines (50 loc) · 1.68 KB
/
ALEXA_IOT.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <Arduino.h>
#include <StreamString.h>
#include <IRac.h>
#include <IRsend.h>
#include <IRutils.h>
#include <IRremoteESP8266.h>
#include <ArduinoJson.h>
#ifdef ENABLE_DEBUG
#define DEBUG_ESP_PORT Serial
#define NODEBUG_WEBSOCKETS
#define NDEBUG
#endif
#ifdef ESP8266
#include <ESP8266WiFi.h>
#endif
#ifdef ESP32
#include <WiFi.h>
#endif
#include "SinricPro.h"
#include "SinricProWindowAC.h"
#define WIFI_SSID "HDSST"
#define WIFI_PASS "###"
#define APP_KEY "####" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
#define APP_SECRET "####" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
#define ACUNIT_ID "####" // Should look like "5dc1564130xxxxxxxxxxxxxx"
#define BAUD_RATE 115200 // Change baudrate to your need
#define kIrLed 14 //Pino onde o LED IR está conectado
#define Protocolo GREE //Substitua pelo Protocolo Obtido no Teste
#define TempMin 16 //Temperatura Mínima do Ar
#define TempMax 32 //Temperatura Máxima do Ar
float globalTemperature;
bool globalPowerState = 0;
int globalFanSpeed;
#define HEARTBEAT_INTERVAL 300000 // 5 Minutes
IRac ac(kIrLed);
int temperature = 16;
String Mode = "Cool"; //Modo de Resfriamento Padrão, para Desumidificador selecionar Modo de Aquecimento
String FanSpeed = "medium";
void turnOn(String deviceId);
void turnOff(String deviceId);
void SendCommand(int Temp, bool Turbo, String Mode, bool Swing, String FanSpeed);
void setup() {
pinMode(kIrLed, OUTPUT);
Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupWiFi();
setupSinricPro();
}
void loop() {
SinricPro.handle();
}