Home Assistant Core 2022.4: Switch Customisation Made Simple

Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.

With the release of Home Assistant Core 2022.4, the way you interact with switches in your smart home has evolved. The new “Switch as X” helper gives you the ability to customize each switch’s function, whether it's controlling a light, fan, or cover. This update means that switches in Home Assistant are no longer treated uniformly; you can define their roles within your home automation system.

Screenshot of a section titled “Controls” in the Home Assistant Dashboard, showing two entries. The first entry is “office/switch/desk (Hidden)” with an icon representing a switch and a toggle switch in the “on” position. The second entry is “office/switch/desk” with an icon representing a lightbulb and a toggle switch in the “on” position. There is an “Add to Dashboard” option at the bottom.

Contents

Customizing Switch Functions

This enhanced functionality is expected to be well-received by the Home Assistant community. With the "Switch as X" helper, you can change an entity titled switch.living_room_light to light.living_room. Home Assistant will then treat that light entity as it would any other light. This makes it easier to use in automations and scripts and allows it to be displayed in light-specific Dashboard cards.

How to Convert a Home Assistant Switch to Another Entity

You have two options to convert a switch into one of the available types.

Option 1: Create a New Helper

  1. Navigate to Helpers: In the Home Assistant UI, go to Settings > Devices & Services > Helpers.
  2. Add Helper: Click on the Add Helper button.
  3. Select Switch as X: Choose the Switch as X option from the list.
  4. Configure: Follow the prompts to select the switch you want to convert and define its new role (light, fan, cover, etc.).
Screenshot of the “Switch as X” configuration interface in Home Assistant. The interface allows the user to select a switch and reassign its type. The selected switch is “office/switch/desk.” Below, there are options to change the switch to a Cover, Fan, Light, Lock, or Siren. The “Light” option is selected. A “Submit” button is in the bottom-right corner of the screen.

Option 2: Update the Switch Entity

  1. Open Entity Settings: Go to Settings > Devices & Services and find the switch entity you intend to convert.
  2. Modify Entity: Click on the switch entity to open its settings.
  3. Select Switch as X: Choose the Switch as X option and define its new role.
  4. Save Changes: Once updated, the original switch entity will be hidden, and the new entity will appear with the selected role.
Screenshot of the settings interface for a switch entity in Home Assistant. The selected entity is “office/switch/desk.” Under the “Settings” tab, the user can change the name, icon, and type of the entity. The current type is set to “Switch,” with a dropdown menu open showing options to change it to Light, Cover, Fan, Lock, or Siren. An “Update” button is visible in the bottom-right corner.

Benefits of Using Switch as X

Switch As X Home Assistant 03 Edit
A white Aqara smart switch with a compact, square design and rounded edges. The front face features the Aqara logo and a small circular button. The top edge has four circular connection ports for wiring. The device has a minimalistic and modern appearance.
A Sonoff smart switch with a rectangular design, featuring a white top and an orange bottom section. The top of the device has the Sonoff logo, a small circular button, and several labeled connection points: N, N, L Out, L In, S1, and S2. The orange section contains corresponding connection ports for wiring. The device has a modern, utilitarian appearance.
A compact white smart plug with a cylindrical design and a European-style socket. The front face features a power button icon and a small indicator light. The design is minimalist, with a smooth surface and clean lines.

Conclusion

The introduction of the Switch as X helper in Home Assistant Core 2022.4 marks a significant step forward in home automation flexibility. By enabling users to customize the functions of their switches, Home Assistant continues to enhance the user experience and simplify the management of smart home devices. Whether you're an advanced Home Assistant user or just getting started, this feature offers valuable new ways to optimize your home automation setup.

Consider experimenting with the Switch as X helper to see how it can enhance your smart home experience. For more detailed guidance and community support, refer to the Home Assistant forums and documentation.

A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.

Leave a comment

Share to...