- platform: mqtt
name: "Shelly DW2 Status"
state_topic: "shellies/shellydw2-x/sensor/state"
value_template: "{{ 'offen' if value == 'open' else 'geschlossen' }}"
This template assumes there are only two states reported by the Shelly device (open/closed). If there are more states reported then the template will need to be enhanced.
The choice between using an MQTT Sensor and an MQTT Binary Sensor depends on the application. If the Shelly device only reports two states then you may as well model it as an MQTT Binary Sensor. Otherwise model it as an MQTT Sensor which permits more than two states and the state names can be whatever you want.
You’re welcome. However you should mark koying’s post with the Solution tag because it was the first to suggest using an MQTT Binary Sensor with a device_class.