I need your advice on the brightness slider for the Lovelace light card.
I have an infrared controlled LED ceiling light and the control in Home Assistant is using the smart infrared remote controller API.
This light is at maximum brightness when turned on and the brightness can be changed in 6 levels.
The brightness is controlled by input_number and automation, and I would like to integrate this with template light, but the brightness slider does not show up on the Lovelace light card.
I would like to ask you to point out if there is any mistake in my light settings.
My native language is not English, so I apologize if my English is poor.
input_number:
light_brightness:
name: light_brightness
min: 0
max: 8
mode: slider
light:
- platform: template
lights:
study_light:
value_template: "{{ states('input_boolean.light_study') }}"
level_template: "{{ states('input_number.light_brightness') }}"
turn_on:
- service: rest_command.light_study_on
- service: input_boolean.turn_on
entity_id: input_boolean.light_study
- service: input_number.set_value
target:
entity_id: input_number.light_brightness
data:
value: 8
turn_off:
- service: rest_command.light_study_off
- service: input_boolean.turn_off
entity_id: input_boolean.light_study
- service: input_number.set_value
target:
entity_id: input_number.light_brightness
data:
value: 0
automation:
- id: ' '
alias: brightness down
description: ''
trigger:
- entity_id: input_number.light_brightness
platform: state
condition:
- condition: numeric_state
entity_id: input_number.light_brightness
above: '0'
- condition: state
entity_id: light.study_light
state: 'on'
action:
- repeat:
count: '{{ trigger.from_state.state|int - trigger.to_state.state|int }}'
sequence:
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 250
- service: rest_command.light_study_brightness_down
mode: single
- id: ' '
alias: brightness up
description: ''
trigger:
- platform: state
entity_id: input_number.light_brightness
condition:
- condition: numeric_state
entity_id: input_number.light_brightness
below: '8'
- condition: state
entity_id: light.study_light
state: 'on'
action:
- repeat:
count: '{{ trigger.to_state.state|int - trigger.from_state.state|int }}'
sequence:
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 250
- service: rest_command.light_study_brightness_up
mode: single