Template light not showing

I created a light entity with template light in order to set the maximum brightness of my wake up lights.
The brightness level is stored in an input_number helper.
I used the “Check configuration” from developer tools and restarted HA. However, the light entity doesn’t show up anywhere.
I’m using core version 2023.1.2
This is my configuration:

light:
  - platform: template
    lights:
      wake_up_light_brian:
        friendly_name: "Wake-up light Brian"
        value_template: "{{ states('input_number.wake_up_light_brian_brightness')|int > 0 }}"
        level_template: "{{ states('input_number.wake_up_light_brian_brightness')|int }}"
        turn_on:
          service: input_number.set_value
          data:
            value: "255"
          target:
            entity_id: "input_number.wake_up_light_brian_brightness"
        turn_off:
          service: input_number.set_value
          data:
            value: "0"
          target:
            entity_id: "input_number.wake_up_light_brian_brightness"
        set_level:
          service: input_number.set_value
          data:
            value: "{{ brightness }}"
          target:
            entity_id: "input_number.wake_up_light_brian_brightness"

Your template light configuration works fine in my instance. Have you reloaded your configuration?

As an aside, can you explain the reasoning behind a template light that doesn’t have a direct action on a physical entity?

I have reloaded and restarted several times without any result. I moved it up in my configuration.yaml and the statements after this one get executed correctly, but not this one.

I want to use a template light in order to visualize the setting “Wake up light brightness” as a light on the dashboard, so you can easily switch it on and off or set a custom brightness.
The wake-up light itself gets activated by the next_alarm entity of the HA app.

Do you only have one top-level light: section?

Yes, I don’t have any other light: sections in configuration.yaml
Also, there isn’t any error in the Core logs.
Here is my complete configuration.yaml:

# Loads default set of integrations. Do not remove.
default_config:

http:
  ip_ban_enabled: true
  login_attempts_threshold: 5
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

# Recorder
recorder:
  exclude:
    domains:
      - update
      - device_tracker
      - sun
    entity_globs:
      - binary_sensor.fritz_box_7530_*
      - button.fritz_box_7530_*
      - sensor.fritz_box_7530_*
      - sensor.*_battery*
      - sensor.sagem_*
      - sensor.wasmachine_*
      - sensor.*motion*_temperature
      - sensor.*motion*_illuminance
      - switch.*_internet_access
      - switch.nodered_*
      - switch.fritz_box_7530_*
      - binary_sensor.DK-*
  include:
    entities:
      - device_tracker.gsmbrian
      - device_tracker.oneplus_6
      - device_tracker.pc_192_168_129_16
      - device_tracker.gsmstijn
      - device_tracker.oneplusstijn
      - device_tracker.pc_192_168_129_21
      - device_tracker.oneplus_8_pro
      - device_tracker.pc_192_168_129_29
      - device_tracker.s21_ultra_van_vera
      - device_tracker.pc_192_168_129_28

# Text to speech
tts:
#  - platform: google_translate
  - platform: microsoft
    api_key: abcd1234
    region: westeurope
    gender: Female
    language: nl-be
    type: DenaNeural

# Assistant Relay
rest_command:
  assistant_broadcast:
    url: http://homeassistant.local:3000/assistant
    method: POST
    content_type: "application/json"
    payload: '{"command":"{{ command }}", "user":"assrelayuser", "broadcast":true}'

  assistant_converse:
    url: http://homeassistant.local:3000/assistant
    method: POST
    content_type: "application/json"
    payload: '{"command":"{{ command }}", "user":"assrelayuser", "converse":true}'

  assistant_relay:
    url: http://homeassistant.local:3000/assistant
    method: POST
    content_type: "application/json"
    payload: '{"command":"{{ command }}", "user":"assrelayuser"}'

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

light:
  - platform: template
    lights:
      wake_up_light_brian:
        friendly_name: "Wake-up light Brian"
        value_template: "{{ states('input_number.wake_up_light_brian_brightness')|int > 0 }}"
        level_template: "{{ states('input_number.wake_up_light_brian_brightness')|int }}"
        turn_on:
          service: input_number.set_value
          data:
            value: "255"
          target:
            entity_id: "input_number.wake_up_light_brian_brightness"
        turn_off:
          service: input_number.set_value
          data:
            value: "0"
          target:
            entity_id: "input_number.wake_up_light_brian_brightness"
        set_level:
          service: input_number.set_value
          data:
            value: "{{ brightness }}"
          target:
            entity_id: "input_number.wake_up_light_brian_brightness"

# Input helpers
input_boolean:
  run_automations:
    name: Run automations
    icon: mdi:refresh-auto
    initial: on

# Groups

That’s very odd. I’ve added:

light: !include lights.yaml

to my configuration.yaml, and copied your code (without the light:, as the line above covers that) into lights.yaml. Created your input_number helper , reloaded template entities and boom:

Are you sure that the file above is the one that HA is reading?

Ok, I’m feeling very dumb right now. The configuration.yaml file was not saved in Studio Code :man_facepalming: I was under the impression that Studio Code automatically saves the files. So this topic can be closed.