I installed a reed sensor on my main door and connected it to the raspi gpio.
Everything works fine except that it is not displayed with the door sensor icon.
Am I doing something wrong here or is device_class not supported for the gpio-platform?
binary_sensor:
- platform: rpi_gpio
ports:
13: maindoor
device_class: door
binary_sensor.maindoor:
friendly_name: Main Door
icon: mdi:door
if you want the icon to change based on status, then you can create a template sensor based on your binary_sensor.maindoor as the template sensor does support device_class
With the proposed intend I get the following config error: Invalid config for [binary_sensor.rpi_gpio]: [device_class] is an invalid option for [binary_sensor.rpi_gpio]
Device classes are supposed to be replacements for the old mdi:… icon attribute so that we can shrink the frontend icon package.
So therefore all entities for all entities that now implement device class, the icon attribute should be dropped (or return nothing if device class already handles it).
I hope that the gpio binary sensor will support device_class soon as I want to keep my config as simple as possible.