on({id: "sonoff.0.BadSensor.BME280_Temperature"/*BadSensor BME280 Temperature*/, change: "any"}, function (obj) { var value = obj.state.val; var oldValue = obj.oldState.val; if (getState("sonoff.0.BadSensor.BME280_Temperature").val <= -24) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 1); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -23 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -22) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 4); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -22 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -21) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 7); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -20 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -19) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 10); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -18 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -17) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 13); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -16 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -15) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 16); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -14 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -13) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 19); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -12 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -11) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 22); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -10 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -9) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 25); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -8 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -7) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 28); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -6 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -5) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 31); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val >= -4 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -3) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 34); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > -2 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= -1) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 37); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 0 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 1) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 40); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 2 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 3) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 43); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 4 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 5) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 46); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 6 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 7) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 49); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 8 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 9) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 52); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 10 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 11) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 55); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 12 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 13) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 58); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 14 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 15) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 61); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 16 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 17) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 64); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 18 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 19) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 67); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 20 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 21) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 70); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 22 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 23) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 73); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 24 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 25) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 76); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 26 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 27) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 79); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 28 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 29) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 82); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 30 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 31) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 85); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 32 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 33) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 88); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 34 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 35) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 91); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 36 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 37) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 94); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 38 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 39) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 97); } else if (getState("sonoff.0.BadSensor.BME280_Temperature").val > 40 && getState("sonoff.0.BadSensor.BME280_Temperature").val <= 42) { setState("wled.0.40f5202e22ab.seg.0.ix"/*Effect intensity*/, 100); } });