Tuya switch to light override?

I have a Tuya/Smartlife switch that I’d like to show as a light. Can you do something similar to the override like the SonoffLAN addon?

sonoff:
  username: email
  password: abcd
  reload: always  # update device list every time HA starts
  devices:
    1234567890:
      device_class: light
      name: Bar Lights

Use a template light

1 Like

Template Lights are the perfect way to go. But if you’re just quickly redefining some switches, you can also use something like:

light:

  # Pseudo-lights that are actually switches
  - platform: switch
    name: Bettlampe
    entity_id: switch.switch3
  - platform: switch
    name: "Bettlampe klein"
    entity_id: switch.switch5
3 Likes

Did not know that one :slight_smile:

Is there a way to add an icon_template to this to the simple light: entry to get an MDI icon of choice too?

The light.switch platform doesn’t currently support icon_template, see Light Switch and Customizing Entities in the docs.

You can, however, use icon: in the customize: section of your YAML or in the Lovelace UI to change the icon. Per default it uses hass:lightbulb (and the theme’s colours to show on/off states).

Note: Apparently the auto-gen UI will inherit the switch icon for the new light switch while the new Lovelace UI won’t.