I’m trying to use a value template in my binary_sensors.yaml file, but having trouble with the device_class settings.
According to the help pages, (Binary sensor - Home Assistant) there are 23 different classes to chose from, however I’m finding that many of them don’t seem to work.
For instance, when I use device_class: motion or device_class: opening everything works great, however if I use device_class: presence or problem or power I get the following error message in my home_assistant.log and the value templates aren’t loaded:
2018-01-22 12:06:50 ERROR (MainThread) [homeassistant.config] Invalid config for [binary_sensor.template]: value is not allowed for dictionary value @ data[‘sensors’][‘other_presence’][‘device_class’]. Got ‘presence’. (See ?, line ?). Please check the docs at Template - Home Assistant
of course checking the webpage referenced states that the value I chose should work, when in fact it doesn’t.
binary_sensors.yaml:
other_presence: friendly_name: 'Unknown Person Location' value_template: "{{ states.input_boolean.other_person.state == 'on' }}" entity_id: input_boolean.other_person device_class: presence
Changing the word “presence” to “opening” solves the error message, but of course it also means I’m using the wrong device class.