Make a switch to a light

I have done this as well, the only thing I would like to do is to have a simple switch card to turn a light on and off, however the card always shows a dimmer. Would it be possible to change this?

I have just done this tonight with some Tuya switches. Although the Tuya integration works and the switch entities work fine, the light entities Iā€™ve created from the are always showing greyed out and say ā€œunavailableā€. I have double checked, the entity_id Iā€™m using is the correct id of the Tuya switch.

Reviving an old thread, but anybody knows if this

light:
  - platform: switch
    name: Light Name
    entity_id: switch.name_switch

works for auto discovered devices through MQTT? My Tasmota switches are auto discovered and I canā€™t get them to switch (pun intended) to light. In the UI, if I replace switch.name_switch for light.name_switch, I get the unknown device symbol instead.

If it doesnā€™t work for auto discovered devices, is there an easy way to convert auto discovered MQTT devices to their manual counterparts?

Thanks!

For Tasmota, in the Tasmota console, enter the commands
setoption30 1
setoption19 1

then your auto-discovered switches will be converted to auto-discovered lights.

2 Likes

That was SO easy!

This community is awesome :smile:

Thanks!

Iā€™m using an iFan03.

Question #1: How do I set the light to a light, but leave the fan speeds as a switch.

Question #2: How do I undo what I just did before I realized that all switches would be converted to a light. :roll_eyes: :man_facepalming: :rofl:

1 Like

hello all

I have a zigbee device that is detected as a switch and I need to convert into a light to use the dimmer with the slide option once this switch is also a dimmer. I try to use this

light:
  - platform: switch
    name: Light Name
    entity_id: switch.name_switch

Bu I canā€™t find the way to discover the entity_id for the light after

Can anyone please help me ?

Thank you !!

Have you looked in the states list?

I would expect it to be light.light_name with the example code you posted.

Hello and thank you for your reply.

Yes I look into the states list also i have the following config:

light:
  - platform: switch
    name: Dimmer
    entity_id: switch.smart_plug_14

And spose I find the dimmer as entity into the states list, but not ā€¦

Yeah that would be light.dimmer.

Any errors in the logs?

Once again thank you for your reply

but no info in the log related to this issue and not entity over the state list ā€¦

What other entities do you have?

ie where you typed dimmer, type ā€˜light.ā€™ in case it has another name?

Also, confirm that you restarted homeassistant after adding that to your configuration?

I just try with other name and perform the search without success for now, and yes I have performed the restart to the HA after the changes in the config file

Do you have more than one light: section?

No just one

post your whole config then.

Thank you I check all the config and yes I have other light section as you mentioned ā€¦

Sorry and that you for your support id now working. Great best regards

Hi All,

Iā€™m trying to convert a switch to light, i canā€™t get it working.

Device in HA version 0.118.1:
image

light.yaml

  • platform: switch
    name: Staande lamp Woonkamer
    entity_id: switch.staande_lamp_woonkamer

What is wrong?

light.yaml

  • platform: switch
    name: ā€œStaande lamp Woonkamerā€
    entity_id: switch.staande_lamp_woonkamer

    quotes

below works for me:

light:
  - platform: switch
    name: xxx2
    entity_id: switch.xxx1