alias: "!Background - Kitchen - Master Knob Control" description: "" trigger: - platform: event event_type: zha_event event_data: device_ieee: 70:ac:08:ff:fe:11:a1:90 enabled: true alias: When any knob zha_event is fired (ieee identified) condition: [] action: - if: - condition: template value_template: "{{ trigger.event.data.command == 'toggle' }}" alias: See if this dumb ass knob really toggled then: - service: input_number.set_value entity_id: input_number.kitchen_rgb_mode data: value: > {% set mode = 0 %} {% set mode = states('input_number.kitchen_rgb_mode') | int + 1 %} {% if mode > 4 %} {% set mode = 0 %} {% endif %} {{ mode | int }} alias: It toggled, so add number to mode tracker - choose: - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 0 }}" alias: IF Mode 0 = OFF enabled: true sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: Tell on/off toggler to off - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 1 }}" alias: IF Mode 1 = Kelvin, AKA Temperature (cool/Warm) enabled: true sequence: - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: tell on/off toggler to on - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 2 }}" alias: IF Mode 2 = RGB enabled: true sequence: - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: tell on/off toggler to on - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 3 }}" alias: IF Mode 3 = Brightness sequence: - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: tell on/off toggler to on alias: Now make sure it does some with new mode else: - variables: COMMENT_ONLY_0: >- ____________________________________________________________________________ COMMENT_ONLY_1: >- >You need 4 input_number and 1 input_text helpers to do it the way I did< COMMENT_ONLY_2: >- >I use helpers rather than directly controlling lights because it allows me< COMMENT_ONLY_3: >- >to use those helpers with other automations and script easily, however< COMMENT_ONLY_4: >- >doing this also means you need automations to handle the helper values< COMMENT_ONLY_5: ">make sure number helpers have value limits or will get broke<" COMMENT_ONLY_6: >- ____________________________________________________________________________ COMMENT_ONLY_7: >- >This rgb_id_tracker helper tracks a number from 0 to 1530. We use that number to associate a usable RGB value from a list< rgb_id_tracker: "{{ states('input_number.kitchen_rgb_track') }}" COMMENT_ONLY_8: >- >This rgb_color_value helper will store a raw RGB value in the format of, '255,255,255'< rgb_color_value: "{{ states('input_text.kitchen_rgb_color_value') }}" COMMENT_ONLY_9: >- >This rightness_level helper will store a brightness step value from 0 to 255 (not a percentage)< brightness_level: "{{ states('input_number.kitchen_rgb_brightness') }}" COMMENT_ONLY_10: >- >This kelvin_level helper will store a basic kelvin value between 2000 and 6500< kelvin_level: "{{ states('input_number.kitchen_rgb_temperature') }}" COMMENT_ONLY_11: >- >This led_mode helper will store a number between 0 and 4. this number is what gets changed when the knob is pressed and is whats used to act on the knob being turned.< led_mode: "{{ states('input_number.kitchen_rgb_mode') }}" knob_press: "{{ trigger.event.data.params.press_type }}" knob_step: "{{ trigger.event.data.params.step_size }}" knob_speed: "{{ trigger.event.data.params.transition_time }}" knob_direction: "{{ trigger.event.data.params.step_mode }}" knob_direction_num_convert: | {% if knob_direction == "StepMode.Down" %} 1 {% else %} 0 {% endif %} knob_step_speed_calc: "{{ (knob_step / 2.5) * knob_speed }}" knob_step_speed_result: "{{ knob_step_speed_calc | int }}" new_mode: | {% if knob_direction == "StepMode.Down" %} {{ rgb_id_tracker - knob_step_speed_result }} {% else %} {{ rgb_id_tracker + knob_step_speed_result }} {% endif %} alias: Define basic bitch ass variables for mathin enabled: true - choose: - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 0 }}" alias: IF Mode 0 = OFF enabled: true sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: Prob don't need this but tell toggle to off - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 1 }}" alias: IF Mode 1 = Kelvin, AKA Temperature (cool/Warm) enabled: true sequence: - variables: kelvin_to_rgb: - 255,138,18 - 255,142,33 - 255,147,44 - 255,152,54 - 255,157,63 - 255,161,72 - 255,165,79 - 255,169,87 - 255,173,94 - 255,177,101 - 255,180,107 - 255,184,114 - 255,187,120 - 255,190,126 - 255,193,132 - 255,196,137 - 255,199,143 - 255,201,148 - 255,204,153 - 255,206,159 - 255,209,163 - 255,211,168 - 255,213,173 - 255,215,177 - 255,217,182 - 255,219,186 - 255,221,190 - 255,223,194 - 255,225,198 - 255,227,202 - 255,228,206 - 255,230,210 - 255,232,213 - 255,233,217 - 255,235,220 - 255,236,224 - 255,238,227 - 255,239,230 - 255,240,233 - 255,242,236 - 255,243,239 - 255,244,242 - 255,245,245 - 255,246,247 - 255,248,251 - 255,249,253 kelvin_value_index: | {% if knob_direction_num_convert == 0 %} {% set new_kelvin = (kelvin_level + knob_step_speed_result * (knob_speed * 3)) %} {% if new_kelvin >= 6500 %} {% set new_kelvin = 6500 %} {% endif %} {% else %} {% set new_kelvin = (kelvin_level - knob_step_speed_result * (knob_speed * 3)) %} {% if new_kelvin < 2000 %} {% set new_kelvin = 2000 %} {% endif %} {% endif %} {{ new_kelvin | int }} new_kelvin_value: >- {% set rounded_kelvin = (kelvin_value_index // 100) * 100 %} {% set index = (rounded_kelvin - 2000) // 100 %} {{ kelvin_to_rgb[index] }} enabled: true alias: >- Define Kelvin to RGB list & Variables - Convert Kelvin to usable RGB values (Kelvin range=2000-6500) - service: input_number.set_value target: entity_id: input_number.kitchen_rgb_temperature data: value: | {% if knob_direction_num_convert == 0 %} {% set new_kelvin = (kelvin_level + knob_step_speed_result * (knob_speed * 3)) %} {% if new_kelvin >= 6500 %} {% set new_kelvin = 6500 %} {% endif %} {% else %} {% set new_kelvin = (kelvin_level - knob_step_speed_result * (knob_speed * 3)) %} {% if new_kelvin < 2000 %} {% set new_kelvin = 2000 %} {% endif %} {% endif %} {{ new_kelvin | int }} enabled: true alias: Add or Subtract Kelvin Value for new input number helper value - service: input_text.set_value data: value: "{{ new_kelvin_value }}" target: entity_id: input_text.kitchen_kelvin_to_rgb alias: Write RGB equivalent Kelvin value to helper for ease of use - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: Turn on on/off toggle - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 2 }}" alias: IF Mode 2 = Kelvin Brightness sequence: - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: Turn on on/off toggle - service: input_number.set_value target: entity_id: input_number.kitchen_rgb_brightness data: value: | {% if knob_direction_num_convert == 0 %} {% set new_bright_value = (brightness_level + knob_step_speed_result * 0.7) %} {% if new_bright_value >= 255 %} {% set new_bright_value = 255 %} {% endif %} {% else %} {% set new_bright_value = (brightness_level - knob_step_speed_result * 0.7) %} {% if new_bright_value < 0 %} {% set new_bright_value = 0 %} {% endif %} {% endif %} {{ new_bright_value | int }} enabled: true alias: >- Change brightness (in step format) based off knob input and write to helper - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 3 }}" alias: IF Mode 3 = RGB enabled: true sequence: - variables: rgb_codes: - 255,0,0 - 255,1,0 - 255,2,0 - 255,3,0 - 255,4,0 - 255,5,0 - 255,6,0 - 255,7,0 - 255,8,0 - 255,9,0 - 255,10,0 - 255,11,0 - 255,12,0 - 255,13,0 - 255,14,0 - 255,15,0 - 255,16,0 - 255,17,0 - 255,18,0 - 255,19,0 - 255,20,0 - 255,21,0 - 255,22,0 - 255,23,0 - 255,24,0 - 255,25,0 - 255,26,0 - 255,27,0 - 255,28,0 - 255,29,0 - 255,30,0 - 255,31,0 - 255,32,0 - 255,33,0 - 255,34,0 - 255,35,0 - 255,36,0 - 255,37,0 - 255,38,0 - 255,39,0 - 255,40,0 - 255,41,0 - 255,42,0 - 255,43,0 - 255,44,0 - 255,45,0 - 255,46,0 - 255,47,0 - 255,48,0 - 255,49,0 - 255,50,0 - 255,51,0 - 255,52,0 - 255,53,0 - 255,54,0 - 255,55,0 - 255,56,0 - 255,57,0 - 255,58,0 - 255,59,0 - 255,60,0 - 255,61,0 - 255,62,0 - 255,63,0 - 255,64,0 - 255,65,0 - 255,66,0 - 255,67,0 - 255,68,0 - 255,69,0 - 255,70,0 - 255,71,0 - 255,72,0 - 255,73,0 - 255,74,0 - 255,75,0 - 255,76,0 - 255,77,0 - 255,78,0 - 255,79,0 - 255,80,0 - 255,81,0 - 255,82,0 - 255,83,0 - 255,84,0 - 255,85,0 - 255,86,0 - 255,87,0 - 255,88,0 - 255,89,0 - 255,90,0 - 255,91,0 - 255,92,0 - 255,93,0 - 255,94,0 - 255,95,0 - 255,96,0 - 255,97,0 - 255,98,0 - 255,99,0 - 255,100,0 - 255,101,0 - 255,102,0 - 255,103,0 - 255,104,0 - 255,105,0 - 255,106,0 - 255,107,0 - 255,108,0 - 255,109,0 - 255,110,0 - 255,111,0 - 255,112,0 - 255,113,0 - 255,114,0 - 255,115,0 - 255,116,0 - 255,117,0 - 255,118,0 - 255,119,0 - 255,120,0 - 255,121,0 - 255,122,0 - 255,123,0 - 255,124,0 - 255,125,0 - 255,126,0 - 255,127,0 - 255,128,0 - 255,129,0 - 255,130,0 - 255,131,0 - 255,132,0 - 255,133,0 - 255,134,0 - 255,135,0 - 255,136,0 - 255,137,0 - 255,138,0 - 255,139,0 - 255,140,0 - 255,141,0 - 255,142,0 - 255,143,0 - 255,144,0 - 255,145,0 - 255,146,0 - 255,147,0 - 255,148,0 - 255,149,0 - 255,150,0 - 255,151,0 - 255,152,0 - 255,153,0 - 255,154,0 - 255,155,0 - 255,156,0 - 255,157,0 - 255,158,0 - 255,159,0 - 255,160,0 - 255,161,0 - 255,162,0 - 255,163,0 - 255,164,0 - 255,165,0 - 255,166,0 - 255,167,0 - 255,168,0 - 255,169,0 - 255,170,0 - 255,171,0 - 255,172,0 - 255,173,0 - 255,174,0 - 255,175,0 - 255,176,0 - 255,177,0 - 255,178,0 - 255,179,0 - 255,180,0 - 255,181,0 - 255,182,0 - 255,183,0 - 255,184,0 - 255,185,0 - 255,186,0 - 255,187,0 - 255,188,0 - 255,189,0 - 255,190,0 - 255,191,0 - 255,192,0 - 255,193,0 - 255,194,0 - 255,195,0 - 255,196,0 - 255,197,0 - 255,198,0 - 255,199,0 - 255,200,0 - 255,201,0 - 255,202,0 - 255,203,0 - 255,204,0 - 255,205,0 - 255,206,0 - 255,207,0 - 255,208,0 - 255,209,0 - 255,210,0 - 255,211,0 - 255,212,0 - 255,213,0 - 255,214,0 - 255,215,0 - 255,216,0 - 255,217,0 - 255,218,0 - 255,219,0 - 255,220,0 - 255,221,0 - 255,222,0 - 255,223,0 - 255,224,0 - 255,225,0 - 255,226,0 - 255,227,0 - 255,228,0 - 255,229,0 - 255,230,0 - 255,231,0 - 255,232,0 - 255,233,0 - 255,234,0 - 255,235,0 - 255,236,0 - 255,237,0 - 255,238,0 - 255,239,0 - 255,240,0 - 255,241,0 - 255,242,0 - 255,243,0 - 255,244,0 - 255,245,0 - 255,246,0 - 255,247,0 - 255,248,0 - 255,249,0 - 255,250,0 - 255,251,0 - 255,252,0 - 255,253,0 - 255,254,0 - 255,255,0 - 254,255,0 - 253,255,0 - 252,255,0 - 251,255,0 - 250,255,0 - 249,255,0 - 248,255,0 - 247,255,0 - 246,255,0 - 245,255,0 - 244,255,0 - 243,255,0 - 242,255,0 - 241,255,0 - 240,255,0 - 239,255,0 - 238,255,0 - 237,255,0 - 236,255,0 - 235,255,0 - 234,255,0 - 233,255,0 - 232,255,0 - 231,255,0 - 230,255,0 - 229,255,0 - 228,255,0 - 227,255,0 - 226,255,0 - 225,255,0 - 224,255,0 - 223,255,0 - 222,255,0 - 221,255,0 - 220,255,0 - 219,255,0 - 218,255,0 - 217,255,0 - 216,255,0 - 215,255,0 - 214,255,0 - 213,255,0 - 212,255,0 - 211,255,0 - 210,255,0 - 209,255,0 - 208,255,0 - 207,255,0 - 206,255,0 - 205,255,0 - 204,255,0 - 203,255,0 - 202,255,0 - 201,255,0 - 200,255,0 - 199,255,0 - 198,255,0 - 197,255,0 - 196,255,0 - 195,255,0 - 194,255,0 - 193,255,0 - 192,255,0 - 191,255,0 - 190,255,0 - 189,255,0 - 188,255,0 - 187,255,0 - 186,255,0 - 185,255,0 - 184,255,0 - 183,255,0 - 182,255,0 - 181,255,0 - 180,255,0 - 179,255,0 - 178,255,0 - 177,255,0 - 176,255,0 - 175,255,0 - 174,255,0 - 173,255,0 - 172,255,0 - 171,255,0 - 170,255,0 - 169,255,0 - 168,255,0 - 167,255,0 - 166,255,0 - 165,255,0 - 164,255,0 - 163,255,0 - 162,255,0 - 161,255,0 - 160,255,0 - 159,255,0 - 158,255,0 - 157,255,0 - 156,255,0 - 155,255,0 - 154,255,0 - 153,255,0 - 152,255,0 - 151,255,0 - 150,255,0 - 149,255,0 - 148,255,0 - 147,255,0 - 146,255,0 - 145,255,0 - 144,255,0 - 143,255,0 - 142,255,0 - 141,255,0 - 140,255,0 - 139,255,0 - 138,255,0 - 137,255,0 - 136,255,0 - 135,255,0 - 134,255,0 - 133,255,0 - 132,255,0 - 131,255,0 - 130,255,0 - 129,255,0 - 128,255,0 - 127,255,0 - 126,255,0 - 125,255,0 - 124,255,0 - 123,255,0 - 122,255,0 - 121,255,0 - 120,255,0 - 119,255,0 - 118,255,0 - 117,255,0 - 116,255,0 - 115,255,0 - 114,255,0 - 113,255,0 - 112,255,0 - 111,255,0 - 110,255,0 - 109,255,0 - 108,255,0 - 107,255,0 - 106,255,0 - 105,255,0 - 104,255,0 - 103,255,0 - 102,255,0 - 101,255,0 - 100,255,0 - 99,255,0 - 98,255,0 - 97,255,0 - 96,255,0 - 95,255,0 - 94,255,0 - 93,255,0 - 92,255,0 - 91,255,0 - 90,255,0 - 89,255,0 - 88,255,0 - 87,255,0 - 86,255,0 - 85,255,0 - 84,255,0 - 83,255,0 - 82,255,0 - 81,255,0 - 80,255,0 - 79,255,0 - 78,255,0 - 77,255,0 - 76,255,0 - 75,255,0 - 74,255,0 - 73,255,0 - 72,255,0 - 71,255,0 - 70,255,0 - 69,255,0 - 68,255,0 - 67,255,0 - 66,255,0 - 65,255,0 - 64,255,0 - 63,255,0 - 62,255,0 - 61,255,0 - 60,255,0 - 59,255,0 - 58,255,0 - 57,255,0 - 56,255,0 - 55,255,0 - 54,255,0 - 53,255,0 - 52,255,0 - 51,255,0 - 50,255,0 - 49,255,0 - 48,255,0 - 47,255,0 - 46,255,0 - 45,255,0 - 44,255,0 - 43,255,0 - 42,255,0 - 41,255,0 - 40,255,0 - 39,255,0 - 38,255,0 - 37,255,0 - 36,255,0 - 35,255,0 - 34,255,0 - 33,255,0 - 32,255,0 - 31,255,0 - 30,255,0 - 29,255,0 - 28,255,0 - 27,255,0 - 26,255,0 - 25,255,0 - 24,255,0 - 23,255,0 - 22,255,0 - 21,255,0 - 20,255,0 - 19,255,0 - 18,255,0 - 17,255,0 - 16,255,0 - 15,255,0 - 14,255,0 - 13,255,0 - 12,255,0 - 11,255,0 - 10,255,0 - 9,255,0 - 8,255,0 - 7,255,0 - 6,255,0 - 5,255,0 - 4,255,0 - 3,255,0 - 2,255,0 - 1,255,0 - 0,255,0 - 0,255,1 - 0,255,2 - 0,255,3 - 0,255,4 - 0,255,5 - 0,255,6 - 0,255,7 - 0,255,8 - 0,255,9 - 0,255,10 - 0,255,11 - 0,255,12 - 0,255,13 - 0,255,14 - 0,255,15 - 0,255,16 - 0,255,17 - 0,255,18 - 0,255,19 - 0,255,20 - 0,255,21 - 0,255,22 - 0,255,23 - 0,255,24 - 0,255,25 - 0,255,26 - 0,255,27 - 0,255,28 - 0,255,29 - 0,255,30 - 0,255,31 - 0,255,32 - 0,255,33 - 0,255,34 - 0,255,35 - 0,255,36 - 0,255,37 - 0,255,38 - 0,255,39 - 0,255,40 - 0,255,41 - 0,255,42 - 0,255,43 - 0,255,44 - 0,255,45 - 0,255,46 - 0,255,47 - 0,255,48 - 0,255,49 - 0,255,50 - 0,255,51 - 0,255,52 - 0,255,53 - 0,255,54 - 0,255,55 - 0,255,56 - 0,255,57 - 0,255,58 - 0,255,59 - 0,255,60 - 0,255,61 - 0,255,62 - 0,255,63 - 0,255,64 - 0,255,65 - 0,255,66 - 0,255,67 - 0,255,68 - 0,255,69 - 0,255,70 - 0,255,71 - 0,255,72 - 0,255,73 - 0,255,74 - 0,255,75 - 0,255,76 - 0,255,77 - 0,255,78 - 0,255,79 - 0,255,80 - 0,255,81 - 0,255,82 - 0,255,83 - 0,255,84 - 0,255,85 - 0,255,86 - 0,255,87 - 0,255,88 - 0,255,89 - 0,255,90 - 0,255,91 - 0,255,92 - 0,255,93 - 0,255,94 - 0,255,95 - 0,255,96 - 0,255,97 - 0,255,98 - 0,255,99 - 0,255,100 - 0,255,101 - 0,255,102 - 0,255,103 - 0,255,104 - 0,255,105 - 0,255,106 - 0,255,107 - 0,255,108 - 0,255,109 - 0,255,110 - 0,255,111 - 0,255,112 - 0,255,113 - 0,255,114 - 0,255,115 - 0,255,116 - 0,255,117 - 0,255,118 - 0,255,119 - 0,255,120 - 0,255,121 - 0,255,122 - 0,255,123 - 0,255,124 - 0,255,125 - 0,255,126 - 0,255,127 - 0,255,128 - 0,255,129 - 0,255,130 - 0,255,131 - 0,255,132 - 0,255,133 - 0,255,134 - 0,255,135 - 0,255,136 - 0,255,137 - 0,255,138 - 0,255,139 - 0,255,140 - 0,255,141 - 0,255,142 - 0,255,143 - 0,255,144 - 0,255,145 - 0,255,146 - 0,255,147 - 0,255,148 - 0,255,149 - 0,255,150 - 0,255,151 - 0,255,152 - 0,255,153 - 0,255,154 - 0,255,155 - 0,255,156 - 0,255,157 - 0,255,158 - 0,255,159 - 0,255,160 - 0,255,161 - 0,255,162 - 0,255,163 - 0,255,164 - 0,255,165 - 0,255,166 - 0,255,167 - 0,255,168 - 0,255,169 - 0,255,170 - 0,255,171 - 0,255,172 - 0,255,173 - 0,255,174 - 0,255,175 - 0,255,176 - 0,255,177 - 0,255,178 - 0,255,179 - 0,255,180 - 0,255,181 - 0,255,182 - 0,255,183 - 0,255,184 - 0,255,185 - 0,255,186 - 0,255,187 - 0,255,188 - 0,255,189 - 0,255,190 - 0,255,191 - 0,255,192 - 0,255,193 - 0,255,194 - 0,255,195 - 0,255,196 - 0,255,197 - 0,255,198 - 0,255,199 - 0,255,200 - 0,255,201 - 0,255,202 - 0,255,203 - 0,255,204 - 0,255,205 - 0,255,206 - 0,255,207 - 0,255,208 - 0,255,209 - 0,255,210 - 0,255,211 - 0,255,212 - 0,255,213 - 0,255,214 - 0,255,215 - 0,255,216 - 0,255,217 - 0,255,218 - 0,255,219 - 0,255,220 - 0,255,221 - 0,255,222 - 0,255,223 - 0,255,224 - 0,255,225 - 0,255,226 - 0,255,227 - 0,255,228 - 0,255,229 - 0,255,230 - 0,255,231 - 0,255,232 - 0,255,233 - 0,255,234 - 0,255,235 - 0,255,236 - 0,255,237 - 0,255,238 - 0,255,239 - 0,255,240 - 0,255,241 - 0,255,242 - 0,255,243 - 0,255,244 - 0,255,245 - 0,255,246 - 0,255,247 - 0,255,248 - 0,255,249 - 0,255,250 - 0,255,251 - 0,255,252 - 0,255,253 - 0,255,254 - 0,255,255 - 0,254,255 - 0,253,255 - 0,252,255 - 0,251,255 - 0,250,255 - 0,249,255 - 0,248,255 - 0,247,255 - 0,246,255 - 0,245,255 - 0,244,255 - 0,243,255 - 0,242,255 - 0,241,255 - 0,240,255 - 0,239,255 - 0,238,255 - 0,237,255 - 0,236,255 - 0,235,255 - 0,234,255 - 0,233,255 - 0,232,255 - 0,231,255 - 0,230,255 - 0,229,255 - 0,228,255 - 0,227,255 - 0,226,255 - 0,225,255 - 0,224,255 - 0,223,255 - 0,222,255 - 0,221,255 - 0,220,255 - 0,219,255 - 0,218,255 - 0,217,255 - 0,216,255 - 0,215,255 - 0,214,255 - 0,213,255 - 0,212,255 - 0,211,255 - 0,210,255 - 0,209,255 - 0,208,255 - 0,207,255 - 0,206,255 - 0,205,255 - 0,204,255 - 0,203,255 - 0,202,255 - 0,201,255 - 0,200,255 - 0,199,255 - 0,198,255 - 0,197,255 - 0,196,255 - 0,195,255 - 0,194,255 - 0,193,255 - 0,192,255 - 0,191,255 - 0,190,255 - 0,189,255 - 0,188,255 - 0,187,255 - 0,186,255 - 0,185,255 - 0,184,255 - 0,183,255 - 0,182,255 - 0,181,255 - 0,180,255 - 0,179,255 - 0,178,255 - 0,177,255 - 0,176,255 - 0,175,255 - 0,174,255 - 0,173,255 - 0,172,255 - 0,171,255 - 0,170,255 - 0,169,255 - 0,168,255 - 0,167,255 - 0,166,255 - 0,165,255 - 0,164,255 - 0,163,255 - 0,162,255 - 0,161,255 - 0,160,255 - 0,159,255 - 0,158,255 - 0,157,255 - 0,156,255 - 0,155,255 - 0,154,255 - 0,153,255 - 0,152,255 - 0,151,255 - 0,150,255 - 0,149,255 - 0,148,255 - 0,147,255 - 0,146,255 - 0,145,255 - 0,144,255 - 0,143,255 - 0,142,255 - 0,141,255 - 0,140,255 - 0,139,255 - 0,138,255 - 0,137,255 - 0,136,255 - 0,135,255 - 0,134,255 - 0,133,255 - 0,132,255 - 0,131,255 - 0,130,255 - 0,129,255 - 0,128,255 - 0,127,255 - 0,126,255 - 0,125,255 - 0,124,255 - 0,123,255 - 0,122,255 - 0,121,255 - 0,120,255 - 0,119,255 - 0,118,255 - 0,117,255 - 0,116,255 - 0,115,255 - 0,114,255 - 0,113,255 - 0,112,255 - 0,111,255 - 0,110,255 - 0,109,255 - 0,108,255 - 0,107,255 - 0,106,255 - 0,105,255 - 0,104,255 - 0,103,255 - 0,102,255 - 0,101,255 - 0,100,255 - 0,99,255 - 0,98,255 - 0,97,255 - 0,96,255 - 0,95,255 - 0,94,255 - 0,93,255 - 0,92,255 - 0,91,255 - 0,90,255 - 0,89,255 - 0,88,255 - 0,87,255 - 0,86,255 - 0,85,255 - 0,84,255 - 0,83,255 - 0,82,255 - 0,81,255 - 0,80,255 - 0,79,255 - 0,78,255 - 0,77,255 - 0,76,255 - 0,75,255 - 0,74,255 - 0,73,255 - 0,72,255 - 0,71,255 - 0,70,255 - 0,69,255 - 0,68,255 - 0,67,255 - 0,66,255 - 0,65,255 - 0,64,255 - 0,63,255 - 0,62,255 - 0,61,255 - 0,60,255 - 0,59,255 - 0,58,255 - 0,57,255 - 0,56,255 - 0,55,255 - 0,54,255 - 0,53,255 - 0,52,255 - 0,51,255 - 0,50,255 - 0,49,255 - 0,48,255 - 0,47,255 - 0,46,255 - 0,45,255 - 0,44,255 - 0,43,255 - 0,42,255 - 0,41,255 - 0,40,255 - 0,39,255 - 0,38,255 - 0,37,255 - 0,36,255 - 0,35,255 - 0,34,255 - 0,33,255 - 0,32,255 - 0,31,255 - 0,30,255 - 0,29,255 - 0,28,255 - 0,27,255 - 0,26,255 - 0,25,255 - 0,24,255 - 0,23,255 - 0,22,255 - 0,21,255 - 0,20,255 - 0,19,255 - 0,18,255 - 0,17,255 - 0,16,255 - 0,15,255 - 0,14,255 - 0,13,255 - 0,12,255 - 0,11,255 - 0,10,255 - 0,9,255 - 0,8,255 - 0,7,255 - 0,6,255 - 0,5,255 - 0,4,255 - 0,3,255 - 0,2,255 - 0,1,255 - 0,0,255 - 1,0,255 - 2,0,255 - 3,0,255 - 4,0,255 - 5,0,255 - 6,0,255 - 7,0,255 - 8,0,255 - 9,0,255 - 10,0,255 - 11,0,255 - 12,0,255 - 13,0,255 - 14,0,255 - 15,0,255 - 16,0,255 - 17,0,255 - 18,0,255 - 19,0,255 - 20,0,255 - 21,0,255 - 22,0,255 - 23,0,255 - 24,0,255 - 25,0,255 - 26,0,255 - 27,0,255 - 28,0,255 - 29,0,255 - 30,0,255 - 31,0,255 - 32,0,255 - 33,0,255 - 34,0,255 - 35,0,255 - 36,0,255 - 37,0,255 - 38,0,255 - 39,0,255 - 40,0,255 - 41,0,255 - 42,0,255 - 43,0,255 - 44,0,255 - 45,0,255 - 46,0,255 - 47,0,255 - 48,0,255 - 49,0,255 - 50,0,255 - 51,0,255 - 52,0,255 - 53,0,255 - 54,0,255 - 55,0,255 - 56,0,255 - 57,0,255 - 58,0,255 - 59,0,255 - 60,0,255 - 61,0,255 - 62,0,255 - 63,0,255 - 64,0,255 - 65,0,255 - 66,0,255 - 67,0,255 - 68,0,255 - 69,0,255 - 70,0,255 - 71,0,255 - 72,0,255 - 73,0,255 - 74,0,255 - 75,0,255 - 76,0,255 - 77,0,255 - 78,0,255 - 79,0,255 - 80,0,255 - 81,0,255 - 82,0,255 - 83,0,255 - 84,0,255 - 85,0,255 - 86,0,255 - 87,0,255 - 88,0,255 - 89,0,255 - 90,0,255 - 91,0,255 - 92,0,255 - 93,0,255 - 94,0,255 - 95,0,255 - 96,0,255 - 97,0,255 - 98,0,255 - 99,0,255 - 100,0,255 - 101,0,255 - 102,0,255 - 103,0,255 - 104,0,255 - 105,0,255 - 106,0,255 - 107,0,255 - 108,0,255 - 109,0,255 - 110,0,255 - 111,0,255 - 112,0,255 - 113,0,255 - 114,0,255 - 115,0,255 - 116,0,255 - 117,0,255 - 118,0,255 - 119,0,255 - 120,0,255 - 121,0,255 - 122,0,255 - 123,0,255 - 124,0,255 - 125,0,255 - 126,0,255 - 127,0,255 - 128,0,255 - 129,0,255 - 130,0,255 - 131,0,255 - 132,0,255 - 133,0,255 - 134,0,255 - 135,0,255 - 136,0,255 - 137,0,255 - 138,0,255 - 139,0,255 - 140,0,255 - 141,0,255 - 142,0,255 - 143,0,255 - 144,0,255 - 145,0,255 - 146,0,255 - 147,0,255 - 148,0,255 - 149,0,255 - 150,0,255 - 151,0,255 - 152,0,255 - 153,0,255 - 154,0,255 - 155,0,255 - 156,0,255 - 157,0,255 - 158,0,255 - 159,0,255 - 160,0,255 - 161,0,255 - 162,0,255 - 163,0,255 - 164,0,255 - 165,0,255 - 166,0,255 - 167,0,255 - 168,0,255 - 169,0,255 - 170,0,255 - 171,0,255 - 172,0,255 - 173,0,255 - 174,0,255 - 175,0,255 - 176,0,255 - 177,0,255 - 178,0,255 - 179,0,255 - 180,0,255 - 181,0,255 - 182,0,255 - 183,0,255 - 184,0,255 - 185,0,255 - 186,0,255 - 187,0,255 - 188,0,255 - 189,0,255 - 190,0,255 - 191,0,255 - 192,0,255 - 193,0,255 - 194,0,255 - 195,0,255 - 196,0,255 - 197,0,255 - 198,0,255 - 199,0,255 - 200,0,255 - 201,0,255 - 202,0,255 - 203,0,255 - 204,0,255 - 205,0,255 - 206,0,255 - 207,0,255 - 208,0,255 - 209,0,255 - 210,0,255 - 211,0,255 - 212,0,255 - 213,0,255 - 214,0,255 - 215,0,255 - 216,0,255 - 217,0,255 - 218,0,255 - 219,0,255 - 220,0,255 - 221,0,255 - 222,0,255 - 223,0,255 - 224,0,255 - 225,0,255 - 226,0,255 - 227,0,255 - 228,0,255 - 229,0,255 - 230,0,255 - 231,0,255 - 232,0,255 - 233,0,255 - 234,0,255 - 235,0,255 - 236,0,255 - 237,0,255 - 238,0,255 - 239,0,255 - 240,0,255 - 241,0,255 - 242,0,255 - 243,0,255 - 244,0,255 - 245,0,255 - 246,0,255 - 247,0,255 - 248,0,255 - 249,0,255 - 250,0,255 - 251,0,255 - 252,0,255 - 253,0,255 - 254,0,255 - 255,0,255 - 255,0,254 - 255,0,253 - 255,0,252 - 255,0,251 - 255,0,250 - 255,0,249 - 255,0,248 - 255,0,247 - 255,0,246 - 255,0,245 - 255,0,244 - 255,0,243 - 255,0,242 - 255,0,241 - 255,0,240 - 255,0,239 - 255,0,238 - 255,0,237 - 255,0,236 - 255,0,235 - 255,0,234 - 255,0,233 - 255,0,232 - 255,0,231 - 255,0,230 - 255,0,229 - 255,0,228 - 255,0,227 - 255,0,226 - 255,0,225 - 255,0,224 - 255,0,223 - 255,0,222 - 255,0,221 - 255,0,220 - 255,0,219 - 255,0,218 - 255,0,217 - 255,0,216 - 255,0,215 - 255,0,214 - 255,0,213 - 255,0,212 - 255,0,211 - 255,0,210 - 255,0,209 - 255,0,208 - 255,0,207 - 255,0,206 - 255,0,205 - 255,0,204 - 255,0,203 - 255,0,202 - 255,0,201 - 255,0,200 - 255,0,199 - 255,0,198 - 255,0,197 - 255,0,196 - 255,0,195 - 255,0,194 - 255,0,193 - 255,0,192 - 255,0,191 - 255,0,190 - 255,0,189 - 255,0,188 - 255,0,187 - 255,0,186 - 255,0,185 - 255,0,184 - 255,0,183 - 255,0,182 - 255,0,181 - 255,0,180 - 255,0,179 - 255,0,178 - 255,0,177 - 255,0,176 - 255,0,175 - 255,0,174 - 255,0,173 - 255,0,172 - 255,0,171 - 255,0,170 - 255,0,169 - 255,0,168 - 255,0,167 - 255,0,166 - 255,0,165 - 255,0,164 - 255,0,163 - 255,0,162 - 255,0,161 - 255,0,160 - 255,0,159 - 255,0,158 - 255,0,157 - 255,0,156 - 255,0,155 - 255,0,154 - 255,0,153 - 255,0,152 - 255,0,151 - 255,0,150 - 255,0,149 - 255,0,148 - 255,0,147 - 255,0,146 - 255,0,145 - 255,0,144 - 255,0,143 - 255,0,142 - 255,0,141 - 255,0,140 - 255,0,139 - 255,0,138 - 255,0,137 - 255,0,136 - 255,0,135 - 255,0,134 - 255,0,133 - 255,0,132 - 255,0,131 - 255,0,130 - 255,0,129 - 255,0,128 - 255,0,127 - 255,0,126 - 255,0,125 - 255,0,124 - 255,0,123 - 255,0,122 - 255,0,121 - 255,0,120 - 255,0,119 - 255,0,118 - 255,0,117 - 255,0,116 - 255,0,115 - 255,0,114 - 255,0,113 - 255,0,112 - 255,0,111 - 255,0,110 - 255,0,109 - 255,0,108 - 255,0,107 - 255,0,106 - 255,0,105 - 255,0,104 - 255,0,103 - 255,0,102 - 255,0,101 - 255,0,100 - 255,0,99 - 255,0,98 - 255,0,97 - 255,0,96 - 255,0,95 - 255,0,94 - 255,0,93 - 255,0,92 - 255,0,91 - 255,0,90 - 255,0,89 - 255,0,88 - 255,0,87 - 255,0,86 - 255,0,85 - 255,0,84 - 255,0,83 - 255,0,82 - 255,0,81 - 255,0,80 - 255,0,79 - 255,0,78 - 255,0,77 - 255,0,76 - 255,0,75 - 255,0,74 - 255,0,73 - 255,0,72 - 255,0,71 - 255,0,70 - 255,0,69 - 255,0,68 - 255,0,67 - 255,0,66 - 255,0,65 - 255,0,64 - 255,0,63 - 255,0,62 - 255,0,61 - 255,0,60 - 255,0,59 - 255,0,58 - 255,0,57 - 255,0,56 - 255,0,55 - 255,0,54 - 255,0,53 - 255,0,52 - 255,0,51 - 255,0,50 - 255,0,49 - 255,0,48 - 255,0,47 - 255,0,46 - 255,0,45 - 255,0,44 - 255,0,43 - 255,0,42 - 255,0,41 - 255,0,40 - 255,0,39 - 255,0,38 - 255,0,37 - 255,0,36 - 255,0,35 - 255,0,34 - 255,0,33 - 255,0,32 - 255,0,31 - 255,0,30 - 255,0,29 - 255,0,28 - 255,0,27 - 255,0,26 - 255,0,25 - 255,0,24 - 255,0,23 - 255,0,22 - 255,0,21 - 255,0,20 - 255,0,19 - 255,0,18 - 255,0,17 - 255,0,16 - 255,0,15 - 255,0,14 - 255,0,13 - 255,0,12 - 255,0,11 - 255,0,10 - 255,0,9 - 255,0,8 - 255,0,7 - 255,0,6 - 255,0,5 - 255,0,4 - 255,0,3 - 255,0,2 - 255,0,1 - 255,0,0 rgb_value_index: | {% if knob_direction_num_convert == 0 %} {% set new_led_mode = (rgb_id_tracker + knob_step_speed_result * knob_speed) % 1530 %} {% else %} {% set new_led_mode = (rgb_id_tracker - knob_step_speed_result * knob_speed) % 1530 %} {% endif %} {{ new_led_mode | int }} new_rgb_value: "{{ rgb_codes[rgb_value_index] }}" enabled: true alias: >- Define a 1500+ RGB value list to get a spectrum of easy to use rgb values - service: input_number.set_value data: value: | {% if knob_direction_num_convert == 0 %} {% set new_led_mode = (rgb_id_tracker + knob_step_speed_result * knob_speed) % 1530 %} {% else %} {% set new_led_mode = (rgb_id_tracker - knob_step_speed_result * knob_speed) % 1530 %} {% endif %} {{ new_led_mode | int }} target: entity_id: input_number.kitchen_rgb_track alias: Use tracker helper and calculate the new RGB value - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: Turn on on/off toggle - service: input_text.set_value data: value: "{{ new_rgb_value }}" target: entity_id: input_text.kitchen_rgb_color_value alias: Use new tracker value to write new RGB value - conditions: - condition: template value_template: "{{ states('input_number.kitchen_rgb_mode') | int == 4 }}" alias: IF Mode 3 = Brightness sequence: - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_rgb_toggle alias: Turn on on/off toggle - service: input_number.set_value target: entity_id: input_number.kitchen_rgb_brightness data: value: | {% if knob_direction_num_convert == 0 %} {% set new_bright_value = (brightness_level + knob_step_speed_result * 0.7) %} {% if new_bright_value >= 255 %} {% set new_bright_value = 255 %} {% endif %} {% else %} {% set new_bright_value = (brightness_level - knob_step_speed_result * 0.7) %} {% if new_bright_value < 0 %} {% set new_bright_value = 0 %} {% endif %} {% endif %} {{ new_bright_value | int }} enabled: true alias: >- Change brightness (in step format) based off knob input and write to helper enabled: true alias: "Now lets read mode #" alias: Did it toggle? If not, then do other mode: single