Change sonoff entity from switch to light

I have a Sonoff switch that I’m using to control some lights. Is it possible to change its entity from Swtich to Light so I can separate it from other switches on the same group, and make it appear in a different card?

Hue emulation is not an option, as I use it combined with a wall switch and it won’t update the status on homebridge: if I turn it off from the switch, it would stay on as a light. It’s sync if used as a switch.

I have mine split according to what they’re controlling, literally just the same code under whichever platform you want.

No idea about Homebridge.

you may wanna use Template Light

I don’t get what you mean. What code are you referring to?

I checked it yesterday, but I don’t see how that would allow me to list the switch as a light. I checked also the Template Switch, but I don’t find a clue either.

How are they set up at the moment?

I simply have the switch added to a group as switch.kitchen_lightw

What code do you have in your configuration.yaml to add the sonoff as an entity in Home Assistant ?

It’s enabled as MQTT platform

  - platform: mqtt
    name: "Kitchen light"
    state_topic: "stat/sonoff02/POWER"
    command_topic: "cmnd/sonoff02/POWER"
    availability_topic: "tele/sonoff02/LWT"
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    optimistic: false
    qos: 1
    retain: true

So that code will be under the

switch:

section in your confirmation.yaml

Cut and paste it so it’s under the

light:

section in your configuration.yaml, reboot HA, and your switch.kitchen_light will become light.kitchen_light

2 Likes

Exactly :slight_smile:

Thanks! It was much easier than what I was trying to do :grin:

Hi @jivesinger

Is it possible to have this setting outside of configuration.yaml?

Thanks

It is if the entity in question was added via some sort of integration

If you use auto-discovery, in the tasmota console :
setoption30 1
setoption19 1

8 Likes

I don’t have an light or switch section in my configuration.yaml. How does it get there?

Mqtt, esphome, some other integration that has Discovery

1 Like

@Eduardo try this:

light:
  - platform: switch
    name: Christmas Tree Lights
    entity_id: switch.christmas_tree_lights

As described in this page here:

1 Like

Do i need to type in each of my sonoff switch enitiy to change it into a light?

light:

  • platform: switch
    name: Christmas Tree Lights
    entity_id: switch.christmas_tree_lights