Eduardo
(Eduardo)
February 8, 2018, 10:20pm
1
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.
lance36
(Lance36)
February 9, 2018, 11:52am
3
you may wanna use Template Light
Eduardo
(Eduardo)
February 9, 2018, 12:22pm
4
I don’t get what you mean. What code are you referring to?
Eduardo
(Eduardo)
February 9, 2018, 12:23pm
5
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?
Eduardo
(Eduardo)
February 9, 2018, 12:59pm
7
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 ?
Eduardo
(Eduardo)
February 9, 2018, 1:11pm
9
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
Eduardo
(Eduardo)
February 10, 2018, 7:32am
12
Thanks! It was much easier than what I was trying to do
pmdroz
(Pmdroz)
January 9, 2020, 5:32pm
13
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
francisp
(Francis)
January 10, 2020, 11:01am
15
If you use auto-discovery, in the tasmota console :
setoption30 1
setoption19 1
8 Likes
ochstobi
(Ochstobi)
February 11, 2020, 3:44pm
16
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
rcruikshank
(Robert Cruikshank)
May 16, 2020, 8:22am
18
@Eduardo try this:
light:
- platform: switch
name: Christmas Tree Lights
entity_id: switch.christmas_tree_lights
As described in this page here:
1 Like
Chew_Yikai
(Chew Yikai)
January 10, 2021, 6:34am
19
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