src/main.cpp
void turnOn(String deviceId) {
  if (deviceId == SwitchId) {// Device ID of first device
    client.publish(mqttTopic, "[ESP8266-IRremote-Alexa] Toggle TV On/Off");
    irsend.sendGC(Samsung_power_toggle, 71);
  }
  else if (deviceId == LightId) {// Device ID of second device
    client.publish(mqttTopic, "[ESP8266-IRremote-Alexa] TV LEDs On");
    irsend.sendNEC(rgbled.On, freq_strip);
    delay(100);
    irsend.sendNEC(rgbled.Green, freq_strip);
    delay(50);
  }
  else {
    Serial.print("Turn on for unknown device id: ");
    Serial.println(deviceId);
  }
}
// deviceId is the ID assgined to your smart-home-device in sinric.com dashboard. Copy it from dashboard and paste it here
deviceId is the ID assgined to your smart-home-device in sinric.com dashboard. Copy it from dashboard and paste it here
deviceId is the ID assgined to your smart - home - device in sinric . com dashboard . Copy it from dashboard and paste it here
void turnOn(String deviceId) {
  if (deviceId == SwitchId) {
    client.publish(mqttTopic, "[ESP8266-IRremote-Alexa] Toggle TV On/Off");
    irsend.sendGC(Samsung_power_toggle, 71);
  }
  else if (deviceId == LightId) {
    client.publish(mqttTopic, "[ESP8266-IRremote-Alexa] TV LEDs On");
    irsend.sendNEC(rgbled.On, freq_strip);
    delay(100);
    irsend.sendNEC(rgbled.Green, freq_strip);
    delay(50);
  }
  else {
    Serial.print("Turn on for unknown device id: ");
    Serial.println(deviceId);
  }
}
void turnOn ( String deviceId ) { if ( deviceId == SwitchId ) { client . publish ( mqttTopic , " " ) ; irsend . sendGC ( Samsung_power_toggle , 71 ) ; } else if ( deviceId == LightId ) { client . publish ( mqttTopic , " " ) ; irsend . sendNEC ( rgbled . On , freq_strip ) ; delay ( 100 ) ; irsend . sendNEC ( rgbled . Green , freq_strip ) ; delay ( 50 ) ; } else { Serial . print ( " " ) ; Serial . println ( deviceId ) ; } }
deviceId is the ID assgined to your smart-home-device in sinric.com dashboard.
deviceId is the ID assgined to your smart - home - device in sinric . com dashboard .
// Device ID of first device // Device ID of second device