WTH, can't use a light as a switch?

Similar to WTH can't I control a switch with light.toggle?, but the other way around.

I have some smart lights and smart outlets (switches) and I’d like to control them uniformly. One way to do that is create a helper entity, a group. However, it’s either a switch group (excluding the lights), or a light group (excluding the switches). I then have to go through hoops of fire:

  1. Convert each of my switches to a light as recommended in Change device type of a switch - Home Assistant (what the heck)
  2. Create a helper light group with my lights and switches
  3. [I did it a while ago, not sure about this one] Convert that helper light back into a switch to get a nice state-reactive icon in the dashboard card

It seems to me that a light is a superset of a switch, so everywhere that a switch can go, a light should go as well.

Light May include dimmer and color controls

Switch may be a garage door

They aren’t really programmatically interchangeable I think?

I remember seeing SONOFF 01MINIZB Zigbee switches showing up as lights and was then able to change it to a switch in ZHA config:

zha:
  device_config:
    00:12:4b:00:24:ca:78:40-1:
      type: 'switch'

See also [BUG] Sonoff ZBMINI classified as light instead of switch · Issue #654 · zigpy/zha-device-handlers · GitHub

you can use “homeassistant.turn_on” and “homeassistant.turn_off”! It works across switches and lights :slight_smile:

1 Like

You can already do this. Go to the entity, click the settings icon, and then show as “light”. It then hides the switch and creates a light entity for the switch.

2 Likes

He wants to do the opposite, showing a light as a switch, and that’s indeed not possible witouth some workarounds

What @Nattfisk said.
This is already implemented since many years back.

Helpers allows this change

Really it hides the entity and create another

You can change a light into another entity using a “template” entity. E.g., see this example to change a Matter Light to a fan: Add ability to switch Matter Device Type - #9 by jvm

Helpers can make a light of a switch, not a switch of a light

I have the same agony… for me, it’s the ability to add a light to a switch group. Or a media player to a switch group. Why can’t we have a generic helper that we can add anything into for just turning on and off devices. I currently use homeassisant.turn_on and turn_off, but it’s in an automation. I have to edit the automation when the device list changes. Rather do it in a helper. I could use a template, or a scene, but why not a helper?

To be honest, I’m not sure where I should write these strings. I imagine it’s in the YAML editor of the automation, but I wouldn’t consider a feature to be implemented until it’s the simplest way to accomplish a goal (in this case, readily available through the UI)

They aren’t interchangeable, true, but the intersection of functionality between a switch and a light (the on/off state and the action of toggling) is still very useful, so I’m advocating to have that intersection be easily accessible

They are in the UI!

1 Like

Use a template switch

2 Likes