Official ESP-IDF component for SinricPro - Control your ESP32 IoT devices with Alexa and Google Home.
- ✅ Voice Control - Works with Alexa and Google Home
- ✅ Real-time - WebSocket-based bidirectional communication
- ✅ Secure - HMAC-SHA256 message signatures
- ✅ Reliable - Auto-reconnection and heartbeat monitoring
- ✅ Event-driven - ESP event loop integration
- ✅ Type Safe - Full C API with optional C++ wrappers
- ✅ Configurable - Kconfig integration
- ✅ Cross-Platform - ESP-IDF v4.4+ and v5.x support
All devices below have complete API support and working examples:
- ✅ Switch - Basic on/off control with physical button
- ✅ Motion Sensor - PIR motion detection
- ✅ Contact Sensor - Door/window reed switch detection
- ✅ Smart Light - RGB color, brightness, color temperature (2200-7000K)
- ✅ DimSwitch - Dimmable switch with brightness control (0-100%)
- ✅ Thermostat - HVAC control with AUTO/COOL/HEAT/ECO/OFF modes
- ✅ Fan - Variable speed control (0-100%)
- ✅ Temperature Sensor - DHT22/DHT11 temperature and humidity
- ✅ Lock - Servo-based lock/unlock control
- ✅ Garage Door - Relay control with position sensors
- ✅ Blinds - Motorized blinds/curtains with position control (0-100%)
- ✅ TV - Volume, mute, media control, input selection, channels
- ✅ Speaker - Volume, mute, media control, equalizer, modes
- ✅ Air Quality Sensor - PM1, PM2.5, PM10 measurements
- ✅ Power Sensor - Voltage, current, power monitoring
- ✅ Window AC - Air conditioner with fan speed and temperature
- ESP-IDF v4.4 or higher. Tested on ESP-IDF 6.1
- ESP32, ESP32-S2, ESP32-S3, ESP32-C3, or ESP32-C6
- SinricPro account (sign up free)
Add to your project's idf_component.yml:
dependencies:
sinricpro/esp-idf: "^1.1.2"cd your_project/components
git clone https://github.com/sinricpro/esp-idf.git sinricproOr
idf.py add-dependency "sinricpro/esp-idf^1.1.2"View at: https://components.espressif.com/components/sinricpro/esp-idf
The component includes 13 complete working examples demonstrating all device types and features:
| Example | Description | Complexity | Hardware |
|---|---|---|---|
| Switch | Basic on/off control | ⭐ Simple | LED, Button |
| Light | RGB LED with color & brightness | ⭐⭐⭐ Complex | RGB LED, PWM |
| DimSwitch | Dimmable light control | ⭐⭐ Medium | LED, PWM |
| Motion Sensor | PIR motion detection | ⭐ Simple | PIR sensor |
| Contact Sensor | Door/window detection | ⭐ Simple | Reed switch |
| Temperature Sensor | Temp & humidity monitoring | ⭐⭐ Medium | DHT22/DHT11 |
| Thermostat | HVAC climate control | ⭐⭐⭐ Complex | Relays, DHT22 |
| Lock | Smart lock control | ⭐⭐ Medium | Servo motor |
| Garage Door | Garage door automation | ⭐⭐⭐ Complex | Relay, Reed switches |
| Fan | Variable speed fan | ⭐⭐ Medium | DC motor, PWM |
| Blinds | Motorized blinds/curtains | ⭐⭐⭐ Complex | DC motor, L298N |
| TV | Media control & channels | ⭐⭐⭐ Complex | Simulated/IR |
| Speaker | Audio control & equalizer | ⭐⭐⭐ Complex | Simulated |
Each example includes:
- Complete working code
- Wiring diagrams
- Voice command examples
- Hardware requirements
- Step-by-step setup guide
- Sign up at sinric.pro
- Create a new Switch device
- Note your
APP_KEY,APP_SECRET, andDEVICE_ID
#include "sinricpro.h"
#include "sinricpro_switch.h"
#define DEVICE_ID "YOUR_DEVICE_ID"
#define APP_KEY "YOUR_APP_KEY"
#define APP_SECRET "YOUR_APP_SECRET"
/* PowerState callback */
static bool on_power_state(const char *device_id, bool *state, void *user_data)
{
printf("Device %s\n", *state ? "ON" : "OFF");
gpio_set_level(GPIO_NUM_2, *state); /* Control LED */
return true; /* Return true for success */
}
void app_main(void)
{
/* Initialize WiFi (code omitted for brevity) */
/* Configure SinricPro */
sinricpro_config_t config = {
.app_key = APP_KEY,
.app_secret = APP_SECRET,
.auto_reconnect = true,
};
/* Initialize */
sinricpro_init(&config);
/* Create switch device */
sinricpro_device_handle_t my_switch = sinricpro_switch_create(DEVICE_ID);
/* Register callback */
sinricpro_switch_on_power_state(my_switch, on_power_state, NULL);
/* Start */
sinricpro_start();
/* Send event (e.g., button press) */
sinricpro_switch_send_power_state_event(my_switch, true,
SINRICPRO_CAUSE_PHYSICAL_INTERACTION);
}idf.py build
idf.py flash monitor- Check existing issues
- Include ESP-IDF version, chip type, and example name
- Provide minimal reproduction code
- Documentation: help.sinric.pro
- Community: Discord - Get help from the community
- Issues: GitHub Issues - Report bugs or request features
- Email: support@sinric.pro - Direct support
- Examples: All examples include detailed README files with troubleshooting
Made with ❤️ by the SinricPro Team