Skip to article frontmatterSkip to article content
Helpers

Inverse

Stranger Things, the upside down πŸ™ƒ

The inverse helper allows you to invert the behavior of a switch or binary sensor entity. On becomes off, and off becomes on. The world is upside down!

This can be helpful if you use a switch or binary sensor in a non-standard way, or when the manufacturer of a device has decided to use the opposite logic for the switch or binary sensor (Yeah... they exist... πŸ€¦β€β™‚οΈ).

It not just inverts the state of the source entity, but also does all service calls in reverse. So if you have an automation call the turn on service on a switch, it will instead call the turn off service on the inverted switch.

Inverting the behavior of an entityΒΆ

The inverse helper can be used to invert the behavior of a switch or binary sensor entity.

Don’t worry! This is really easy and all fully done via the Home Assistant user interface.

Add one directly to your own instance by selecting the My Home Assistant button below:

Open your Home Assistant instance and start setting up a new integration.

Or add one manually, using the following steps:

  1. From the Home Assistant sidebar, select Settings and next select Devices & Services.
  2. Select the Helpers tab.
  3. On the helpers page, in the bottom right corner, select the + Create helper button.
  4. From the list of helpers, select Inverse πŸ‘».
Screenshot of the add helper dialog, which lists the inverse helper.
  1. Select the type of entity you want to invert the behavior of.
Screenshot of the inverse helper dialog, which allows you to select the type of entity to invert.
  1. Provide a name for your new inverted entity this helpers provides, and select the entity you want to invert the behavior of in the Source entity field.
  2. Turn on Hide source entity, if you want to hide the source entity from the Home Assistant interface.
Screenshot of the inverse helper dialog, configuring the new inverted entity.
  1. Select Submit. Done! πŸŽ‰
Screenshot showing the newly inverted switch, created with the procedure described above.