As suggested by fabaff here I open this feature request to improve basic functionality of sensors.
At the moment I have this config:
Excerpt of configuration.yaml:
customize:
!include customize.yaml
Excerpt of customize.yaml:
#Open/Close Windows/Door Sensors
binary_sensor.sigma_designs_unknown_type0003_id0001_sensor_6_0:
friendly_name: 'living entrance door'
device_class: opening
This results in panels/cards like this:
A sensor with class opening should show up with open/closed (now its on/off).
The other sensors are described here: https://home-assistant.io/components/binary_sensor/
There you can find the other states that would be nice to show up.
For the sake of completeness:
@fabaff kindly offered this working solution to achieve correct states:
- platform: template
sensors:
on_off:
value_template: '{% if is_state("input_boolean.control_switch", "off") %}close{% else %}open{% endif %}'
friendly_name: 'Open_Close'