Template Light which only sets input_numbers

Heho
I’m breaking my brain while figuring out how to use the template light entity. Normaly I only need a color wheel card and a slider, but I can’t find any color wheel so I need to go via light entity.

I want to control a light which react on 4 input_number values.
washer_dimmer 0-255
washer_red 0-255
washer_green 0-255
washer_blue 0-255

The template light should only set this values and should not be able to turn something on or off.

light:
  - platform: template
    lights:
      washers:
        friendly_name: washer
        unique_id: washerlight_combined
        value_template: "{{ states('switch.eve_energy_20ecl1301_2')}}"
        level_template: "{{ states('input_number.washer_dimmer')|int }}"        
        rgb_template: "({{ states('input_number.washer_red') | int}} , {{ states('input_number.washer_green') | int }}, {{ states('input_number.washer_blue') | int }})"

        turn_on:
          action: script.deadscript
          data:
            value: 1
        turn_off:
          action: script.deadscript
          data:
            value: 0
        set_rgb: 
          - action: input_number.set_value
            data:
              value: "{{ brightness }}"
              entity_id: input_number.washer_dimmer
        set_level: 
          - action: input_number.set_value
            data:
              value: "{{ r }}"
              entity_id: input_number.washer_red
          - action: input_number.set_value
            data:
              value: "{{ g }}"
              entity_id: input_number.washer_green
          - action: input_number.set_value
            data:
              value: "{{ b }}"
              entity_id: input_number.washer_blue
             

This is my test template, but it does not work.
The deadscript is an empty script without any function.
If I use the light entity I always get this error message:

expected float for dictonary value @ data['value']

Do you know what mistake I made?

turn_on is the way it sets the color.

I found my mistake. I swapped set_rgb and set_level.

Here is the correct one

light:
  - platform: template
    lights:
      washers:
        friendly_name: washer
        unique_id: washerlight_combined
        value_template: "{{ states('switch.eve_energy_20ecl1301_2')}}"
        level_template: "{{ states('input_number.washer_dimmer')|int }}"        
        turn_on:
          action: script.deadscript
          data:
            value: 1
        turn_off:
          action: script.deadscript
          data:
            value: 0
        set_level: 
          - action: input_number.set_value
            data:
              value: "{{ brightness }}"
              entity_id: input_number.washer_dimmer
        set_rgb: 
          - action: input_number.set_value
            data:
              value: "{{ r }}"
              entity_id: input_number.washer_red
          - action: input_number.set_value
            data:
              value: "{{ g }}"
              entity_id: input_number.washer_green
          - action: input_number.set_value
            data:
              value: "{{ b }}"
              entity_id: input_number.washer_blue
              
              
             
             
      
  1. You’re using legacy templates, this is deprecated.
  2. You can just make an optimistic template light.
  3. I’m going to remove your solution because legacy template lights are no longer supported.

Here’s an example of a template light that does the same thing as what your legacy template light does.

template:
- light:
  - default_entity_id: light.washer
    unique_id: washerlight_combined
    state: "{{ states('switch.eve_energy_20ecl1301_2')}}"
    turn_on:
      action: script.deadscript
      data:
        value: 1
    turn_off:
      action: script.deadscript
      data:
        value: 0
    set_level: []
    set_rgb: []

o.o since when are they legacy?
I copied it from the integration-> template page

edit: lol i also see repair actions now. Im confused af xD

They’ve been legacy for 3 months now and the legacy documentation was removed December 2025. I’m not sure what documentation you were using, but it’s outdated and it’s likely not the official documentation.

1 Like