I have a IR lamp which i can manage via a broadlink script and a selection list with all the commands, like on, off and some colors like white etc.
With the new posibilities of hass, specialy the area card and area functionality i like to have this IR lamp device recognized like a real lamp so it will go off when all the light off that area goes off.
So i made an extra template light for the IR light. I manage the IR device via a selection/optionlist.
I cant get this template to work. It gives an error that says that state is an invalid option…
You have made a legacy format template light. See the current docs:
and here’s the legacy section:
Note the top-level template: and the state: in the new config, and no friendly_name. Your older config is under light: and would use value_template instead.
Beware copying old forum posts or tutorials, or using AI — always better to consult the current documentation.
i have followed the advices and it works! THANK YOU ALL!
Only thing that isnt right yet is the section turn_on and off…
I use service: and the templatedoc says to use action…
Do i have to change this, it does work now
- light:
- name: "usblampdummy"
unique_id: usblampdummy
state: >-
{% if is_state('input_select.usblamp', 'uit') %}
off
{% else %}
on
{% endif %}
turn_on:
service: input_select.select_option
data:
option: flame
target:
entity_id: input_select.usblamp
turn_off:
service: input_select.select_option
data:
option: uit
target:
entity_id: input_select.usblamp
thats nicer code!
Now gonna make my first fan template code!
That has a lamp and a fan in one device.
Thinking about splitting them.
Now learned how to make a light template
thanks again