Issue with device_class: presence - Getting errors

So I’ve read as much as I can on this and for the life of me, can’t figure out this problem.
My goal is to have a round badge at the top of my screen with the banner across it that shows “home” or Away. I have created a bayesian sensor that tracks several states of my phone and I am getting good results so far.

In order to create this badge, I’ve created a template sensor. My setup is identical to this one from Paul: HomeKit as a Presence Sensor

Here is my code for this sensor:

  - platform: template
    sensors:
      presence_frontend_dad:
        friendly_name: "Dad"
        device_class: presence
        value_template: >-
          {{ is_state('binary_sensor.dad_presence', 'on') }}      # bayesian sensor

And this is the error message that I am getting:
Invalid config for [sensor.template]: value is not allowed for dictionary value @ data[‘sensors’][‘presence_frontend_dad’][‘device_class’]. Got ‘presence’. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.template/

If I comment out the #device_class: presence line, I have a valid configuration. As soon as I uncomment it, I get the error.

Also I have commented all of my other sensors just to make sure that no others may be involved in this issue. I’ve checked my spacing and replaced all the single quotes as sometimes these don’t do well from a cut and paste job.

Has anyone encountered that same issue previously? Any ideas?

You need the Template Binary Sensor
The Template Sensor has no device_class ‘presence’.

1 Like

OK Great, I’ll try that shortly, I wasn’t aware of the Template Binary Sensor. Thanks