Icons of binary sensor classes

Hi,

I was wondering what the icons for the different binary_sensor classes look like, so I made a minimalistic shell script that generates two sensors for each class, one with state “on” and one “off”:

#!/bin/sh
echo -e "name: 'Binary Sensor Classes and Icons\nentities:"
for class in cold connectivity heat light moisture motion moving occupancy opening power safety smoke sound vibration
do
	for state in ON OFF; do
		echo -e "platform: command_line\nname: ${class} ${state}\ncommand: echo ${state}\nsensor_class: ${class}" >${class}_${state}.yaml
		echo "  - binary_sensor.${class}_${state}"
	done
done

This generates a bunch of files like motion_ON.yaml, motion_OFF.yaml etc. in the current directory and outputs what can be copied&pasted into a group configuration file:

name: 'Binary Sensor Classes and Icons
entities:
  - binary_sensor.cold_ON
  - binary_sensor.cold_OFF
  - binary_sensor.connectivity_ON
  - binary_sensor.connectivity_OFF
  [...]

I have a directory for binary sensor configuration called binary_sensors that is included like this in my configuration.yaml:

binary_sensor: !include_dir_list binary_sensors

The script is intended to be run from inside this (binary_sensors) directory.
Then copy&paste the output into a group configuration file and - if needed - add that group to your default_view.
Restart HA and you’ll see a group with all the possible binary sensors in both states.

Not a big deal, but maybe someone else finds this useful… :wink:

Sebastian

This is nice, I’m also wondering, would it be possible to show a screenshot of these sensors? :smiley:
I always forget what they look like after a while and don’t want to add/remove them every time :wink:

Same here, does anyone have a screenshot of the binary sensor classes?

Here you go:

Sebastian

1 Like

Legend! Thanks!

I’d add the screenshot to the binary sensor documentation, but I have no clue how to do that.
I guess I have to upload the file first, but I don’t seem to have the permissions to do this.

Sebastian