This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SinricPro.h" | |
#include "SinricProSwitch.h" | |
#define WIFI_SSID "YOUR-WIFI-SSID" | |
#define WIFI_PASS "YOUR-WIFI-PASS" | |
#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx" | |
#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx" | |
#define SWITCH_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx" | |
#define BAUD_RATE 9600 // Change baudrate to your need |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SinricPro.h" | |
#include "SinricProLight.h" | |
#define WIFI_SSID "YOUR-WIFI-SSID" | |
#define WIFI_PASS "YOUR-WIFI-PASS" | |
#define APP_KEY "YOUR-APPKEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx" | |
#define APP_SECRET "YOUR-APPSECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx" | |
#define LIGHT_ID "YOUR-DEVICEID" // Should look like "5dc1564130xxxxxxxxxxxxxx" | |
#define BAUD_RATE 9600 // Change baudrate to your need for serial log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Uncomment the following line to enable serial debug output | |
#define ENABLE_DEBUG | |
#ifdef ENABLE_DEBUG | |
#define DEBUG_ESP_PORT Serial | |
#define NODEBUG_WEBSOCKETS | |
#define NDEBUG | |
#endif | |
#include <Arduino.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <EEPROM.h> | |
#define MAGIC_BYTE 0xDD | |
bool checkInit() { | |
return (EEPROM.read(0) == MAGIC_BYTE); | |
} | |
void initializeEEPROM() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* If you encounter any issues: | |
* - check the readme.md at https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md | |
* - ensure all dependent libraries are installed | |
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide | |
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies | |
* - open serial monitor and check whats happening | |
* - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk | |
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct { | |
byte group; // RC SWITCH Group ID | |
byte device; // RC SWITCH DeviceID | |
bool state; // RC SWITCH state (on/off) | |
} config_t; | |
// std:map to hold device configuration and actual device state | |
// could be stored on SPIFFS and configured via local webserver | |
// in this example it's configured static: |
NewerOlder