--- sonoff-orig-master/sonoff.h	Fri Dec  1 05:42:22 2017
+++ sonoff-5.10.0-fireplace/sonoff.h	Fri Dec 29 02:00:48 2017
@@ -131,9 +131,10 @@
 enum LightTypes {LT_BASIC, LT_PWM1, LT_PWM2, LT_PWM3, LT_PWM4, LT_PWM5, LT_PWM6, LT_PWM7, LT_NU8, LT_NU9, LT_NU10, LT_WS2812, LT_RGBW, LT_RGBWC};
 enum LichtSubtypes {LST_NONE, LST_SINGLE, LST_COLDWARM, LST_RGB, LST_RGBW, LST_RGBWC};
 enum LichtSchemes {LS_POWER, LS_WAKEUP, LS_CYCLEUP, LS_CYCLEDN, LS_RANDOM, LS_MAX};
+enum WSLightSchemes { LS_WS_CLOCK, LS_WS_RGB, LS_WS_XMAS, LS_WS_HANNUKAH, LS_WS_KWANZAA, LS_WS_RAINBOW, LS_WS_FIRE, LS_WS_FIREPLACE, LS_WS_MAX};
 
 enum XsnsFunctions {FUNC_XSNS_INIT, FUNC_XSNS_PREP, FUNC_XSNS_JSON_APPEND, FUNC_XSNS_MQTT_SHOW, FUNC_XSNS_WEB};
 
 const uint8_t kDefaultRfCode[9] PROGMEM = { 0x21, 0x16, 0x01, 0x0E, 0x03, 0x48, 0x2E, 0x1A, 0x00 };
 
-#endif  // _SONOFF_H_
\ No newline at end of file
+#endif  // _SONOFF_H_
--- sonoff-orig-master/sonoff_template.h	Fri Dec  1 05:42:22 2017
+++ sonoff-5.10.0-fireplace/sonoff_template.h	Fri Dec 29 00:53:46 2017
@@ -674,17 +674,17 @@
   { "Witty Cloud",     // Witty Cloud Dev Board (ESP8266) - https://www.aliexpress.com/item/ESP8266-serial-WIFI-Witty-cloud-Development-Board-ESP-12F-module-MINI-nodemcu/32643464555.html
      GPIO_USER,        // GPIO00 D3 flash push button on interface board
      GPIO_USER,        // GPIO01 Serial RXD and Optional sensor
-     GPIO_LED1_INV,    // GPIO02 D4 Blue Led (0 = On, 1 = Off) on ESP-12F
+     GPIO_USER,        //AJ: GPIO_LED1_INV,    // GPIO02 D4 Blue Led (0 = On, 1 = Off) on ESP-12F
      GPIO_USER,        // GPIO03 Serial TXD and Optional sensor
      GPIO_KEY1,        // GPIO04 D2 push button on ESP-12F board
      GPIO_USER,        // GPIO05 D1 optional sensor
      0, 0, 0, 0, 0, 0, // Flash connection
-     GPIO_PWM2,        // GPIO12 D6 RGB LED Green
-     GPIO_PWM3,        // GPIO13 D7 RGB LED Blue
+     GPIO_USER,        //AJ:      GPIO_PWM2,        // GPIO12 D6 RGB LED Green
+     GPIO_USER,        //AJ:      GPIO_PWM3,        // GPIO13 D7 RGB LED Blue
      GPIO_USER,        // GPIO14 D5 optional sensor
-     GPIO_PWM1,        // GPIO15 D8 RGB LED Red
+     GPIO_USER,        //AJ:      GPIO_PWM1,        // GPIO15 D8 RGB LED Red
      GPIO_USER,        // GPIO16 D0 optional sensor
-     GPIO_ADC0         // ADC0 A0 Light sensor / Requires USE_ADC_VCC in user_config.h to be disabled
+     GPIO_USER,        //AJ:disabled ca incurca la animatii WS2812?     GPIO_ADC0         // ADC0 A0 Light sensor / Requires USE_ADC_VCC in user_config.h to be disabled
   },
   { "Yunshan Relay",   // Yunshan Wifi Relay (ESP8266) - https://www.ebay.com/p/Esp8266-220v-10a-Network-Relay-WiFi-Module/1369583381
                        // Schematics and Info https://ucexperiment.wordpress.com/2016/12/18/yunshan-esp8266-250v-15a-acdc-network-wifi-relay-module/
@@ -781,4 +781,4 @@
   }
 };
 
-#endif  // _SONOFF_TEMPLATE_H_
\ No newline at end of file
+#endif  // _SONOFF_TEMPLATE_H_
--- sonoff-orig-master/user_config.h	Fri Dec  1 05:42:22 2017
+++ sonoff-5.10.0-fireplace/user_config.h	Sat Dec 30 17:11:20 2017
@@ -110,7 +110,7 @@
 #define TELE_PERIOD            300               // [TelePeriod] Telemetry (0 = disable, 10 - 3600 seconds)
 
 // -- MQTT - Domoticz -----------------------------
-#define USE_DOMOTICZ                             // Enable Domoticz (+6k code, +0.3k mem) - Disable by //
+//#define USE_DOMOTICZ                             // Enable Domoticz (+6k code, +0.3k mem) - Disable by //
   #define DOMOTICZ_IN_TOPIC      "domoticz/in"   // Domoticz Input Topic
   #define DOMOTICZ_OUT_TOPIC     "domoticz/out"  // Domoticz Output Topic
   #define DOMOTICZ_UPDATE_TIMER  0               // [DomoticzUpdateTimer] Send relay status (0 = disable, 1 - 3600 seconds) (Optional)
@@ -121,14 +121,14 @@
   #define WEB_PORT             80                // Web server Port for User and Admin mode
   #define WEB_USERNAME         "admin"           // Web server Admin mode user name
   #define WEB_PASSWORD         ""                // [WebPassword] Web server Admin mode Password for WEB_USERNAME (empty string = Disable)
-  #define FRIENDLY_NAME        "Sonoff"          // [FriendlyName] Friendlyname up to 32 characters used by webpages and Alexa
+  #define FRIENDLY_NAME        "Witty"          // [FriendlyName] Friendlyname up to 32 characters used by webpages and Alexa
   #define USE_EMULATION                          // Enable Belkin WeMo and Hue Bridge emulation for Alexa (+11k code, +2k mem)
     #define EMULATION          EMUL_NONE         // [Emulation] Select Belkin WeMo (single relay/light) or Hue Bridge emulation (multi relay/light) (EMUL_NONE, EMUL_WEMO or EMUL_HUE)
 
 // -- mDNS ----------------------------------------
-#define USE_DISCOVERY                            // Enable mDNS for the following services (+8k code, +0.3k mem) - Disable by //
-  #define WEBSERVER_ADVERTISE                    // Provide access to webserver by name <Hostname>.local/
-  #define MQTT_HOST_DISCOVERY                    // Find MQTT host server (overrides MQTT_HOST if found)
+//#define USE_DISCOVERY                            // Enable mDNS for the following services (+8k code, +0.3k mem) - Disable by //
+//  #define WEBSERVER_ADVERTISE                    // Provide access to webserver by name <Hostname>.local/
+//  #define MQTT_HOST_DISCOVERY                    // Find MQTT host server (overrides MQTT_HOST if found)
 
 // -- Time - Up to three NTP servers in your region
 #define NTP_SERVER1            "pool.ntp.org"       // [NtpServer1] Select first NTP server by name or IP address (129.250.35.250)
@@ -152,7 +152,7 @@
 
 #define KEY_HOLD_TIME          40                // [SetOption32] Number of 0.1 seconds to hold Button or external Pushbutton before sending HOLD message
 #define SWITCH_MODE            TOGGLE            // [SwitchMode] TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV or PUSHBUTTON_TOGGLE (the wall switch state)
-#define WS2812_LEDS            30                // [Pixels] Number of WS2812 LEDs to start with
+#define WS2812_LEDS            120                // [Pixels] Number of WS2812 LEDs to start with
 
 #define TEMP_CONVERSION        0                 // [SetOption8] Return temperature in (0 = Celsius or 1 = Fahrenheit)
 #define TEMP_RESOLUTION        1                 // [TempRes] Maximum number of decimals (0 - 3) showing sensor Temperature
@@ -161,7 +161,7 @@
 #define ENERGY_RESOLUTION      3                 // [EnergyRes] Maximum number of decimals (0 - 5) showing energy usage in kWh
 
 // -- Sensor code selection -----------------------
-#define USE_ADC_VCC                              // Display Vcc in Power status. Disable for use as Analog input on selected devices
+//#define USE_ADC_VCC                              // Display Vcc in Power status. Disable for use as Analog input on selected devices
 
                                                  // WARNING: Select none for default one DS18B20 sensor or enable one of the following two options for multiple sensors
 //#define USE_DS18x20                              // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1.3k code)
@@ -183,7 +183,7 @@
 
 #define USE_WS2812                               // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem) - Disable by //
   #define USE_WS2812_CTYPE     1                 // WS2812 Color type (0 - RGB, 1 - GRB, 2 - RGBW, 3 - GRBW)
-//  #define USE_WS2812_DMA                         // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
+  #define USE_WS2812_DMA                         // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
 
 #define USE_ARILUX_RF                            // Add code for Arilux RF remote controller (+0.8k code)
 
@@ -204,4 +204,4 @@
   #error "Select either USE_MQTT_TLS or USE_WEBSERVER as there is just not enough memory to play with"
 #endif
 
-#endif  // _USER_CONFIG_H_
+#endif  // _USER_CONFIG_H_
--- sonoff-orig-master/xdrv_light.ino	Fri Dec  1 05:42:22 2017
+++ sonoff-5.10.0-fireplace/xdrv_light.ino	Fri Dec 29 01:53:06 2017
@@ -48,6 +48,7 @@
  * 10            yes     no         no          Kwanzaa
  * 11            yes     no         no          Rainbow
  * 12            yes     no         no          Fire
+ * 13            yes     no         no          Fireplace
  *
 \*********************************************************************************************/
 
@@ -373,7 +374,7 @@
     light_subtype++;  // from RGB to RGBW
 #endif
     Ws2812Init();
-    max_scheme = LS_MAX +7;
+    max_scheme = LS_MAX +LS_WS_MAX;
   }
 #endif  // USE_WS2812 ************************************************************************
   else {
@@ -635,6 +636,9 @@
         light_new_color[i] = 0;
       }
     }
+#ifdef USE_WS2812 //AJ: strip sometimes not cleared
+    Ws2812Clear();
+#endif
   }
   else {
     sleep = 0;
@@ -1029,7 +1033,7 @@
   }
 #endif  // USE_WS2812 ************************************************************************
   else if ((CMND_SCHEME == command_code) && (light_subtype >= LST_RGB)) {
-    uint8_t max_scheme = (LT_WS2812 == light_type) ? LS_MAX +7 : LS_MAX -1;
+    uint8_t max_scheme = (LT_WS2812 == light_type) ? LS_MAX +LS_WS_MAX : LS_MAX -1;
     if (('+' == option) && (Settings.light_scheme < max_scheme)) {
       payload = Settings.light_scheme + ((0 == Settings.light_scheme) ? 2 : 1);  // Skip wakeup
     }
@@ -1149,4 +1153,4 @@
   }
   return serviced;
 }
-
+
--- sonoff-orig-master/xdrv_ws2812.ino	Fri Dec  1 05:42:22 2017
+++ sonoff-5.10.0-fireplace/xdrv_ws2812.ino	Sat Dec 30 23:39:24 2017
@@ -62,14 +62,16 @@
 WsColor kwanzaa[3] = { 255,0,0, 0,0,0, 0,255,0 };
 WsColor kRainbow[7] = { 255,0,0, 255,128,0, 255,255,0, 0,255,0, 0,0,255, 128,0,255, 255,0,255 };
 WsColor kFire[3] = { 255,0,0, 255,102,0, 255,192,0 };
-ColorScheme kSchemes[7] = {
+WsColor kFireplace[2] = {255,125,0, 0,0,0 };
+ColorScheme kSchemes[8] = {
   kIncandescent, 2,
   kRgb, 3,
   kChristmas, 2,
   kHanukkah, 2,
   kwanzaa, 3,
   kRainbow, 7,
-  kFire, 3 };
+  kFire, 3,
+  kFireplace, 2};
 
 uint8_t kWidth[5] = {
     1,     // Small
@@ -122,6 +124,8 @@
 
 #define cmin(a,b) ((a)<(b)?(a):(b))
 
+#define cmax(a,b) ((a)>(b)?(a):(b))
+
 void Ws2812UpdatePixelColor(int position, struct WsColor hand_color, float offset)
 {
 #if (USE_WS2812_CTYPE > 1)
@@ -291,6 +295,29 @@
   Ws2812StripShow();
 }
 
+void Ws2812Fireplace(void)
+{
+  #if (USE_WS2812_CTYPE > 1)
+    RgbwColor c;
+    c.W = 0;
+  #else
+    RgbColor c;
+  #endif
+  int i, flicker;
+  float dimmer = 100 / (float)Settings.light_dimmer;
+  
+  for (i = 0; i < Settings.light_pixels; i++) {
+    flicker = random(0,255);
+    float fmyRed = (float)cmax(255 - flicker,0) / dimmer;
+    float fmyGrn = (float)cmax(123 - flicker,0) / dimmer;
+    c.R = (uint8_t)fmyRed;
+    c.G = (uint8_t)fmyGrn;
+    c.B = 0;
+    strip->SetPixelColor(i, c);
+  }
+  Ws2812StripShow();
+}
+
 /*********************************************************************************************\
  * Public
 \*********************************************************************************************/
@@ -386,6 +413,10 @@
         ws_show_next = 0;
       }
       break;
+    case 8: //AJ-FIXME: Seems like a hack to hardcode it.. Fireplace 13-LS_MAX
+        Ws2812Fireplace();
+        ws_show_next = 1;
+      break;
     default:
       if (1 == Settings.light_fade) {
         Ws2812Gradient(scheme -1);
@@ -397,4 +428,4 @@
   }
 }
 
-#endif  // USE_WS2812
+#endif  // USE_WS2812
