Template binary sensor from attribute (Ecobee)

I can’t seem to get this to work. I am trying to make a binary sensor template to show whether the Fan attribute for an Ecobee thermostat is on. In other words, I want a sensor that will tell me if the fan on the furnace is running. I’ve tried several variants of the following:

binary_sensor:
  - platform: template
    sensors:
      furnace_fan_living_room:
        friendly_name: Fan Running
        device_class:
        value template: "{{ is_state_attr('climate.entryway' ,'fan' ,'on') }}"

Any help much appreciated.

1st value_template: missing underline _
2rd device_class: https://www.home-assistant.io/integrations/binary_sensor/
3rd friendly_name: I would put in side quotes “Fan Running”

here read this

I did lean something like the “is_state_attr()” did not know about that nice.

LOL @123

Your value_template is missing the underscore character.

Your device_class option fails to specify a device class. Either add one or remove the option.

Did you run Configuration Check? Because all of these syntax errors would be identified by it.


EDIT
Ninja’d by myle.

Thanks all. The missing underscore in value_template was the problem. I must have dropped it accidentally when trying different variations.

The configure checker in the File Editor was telling me that the original formulation was ok. Not sure why. It gave me errors for a bunch of other variations.

That’s not a proper “configure checker”. This is what you should use after modifying anything YAML-based:

Configuration > Server Controls > Check Configuration

Screenshot from 2020-05-07 09-56-05

1 Like