Attribute extraction issue

HI,
I hope someone can help! What am I doing wrong with the code below? I keep getting unknown as result…

  - platform: template
    sensors:
      evstatus:
        friendly_name: 'evstatus'
        unit_of_measurement: ''
        value_template: "{{ state_attr('switch.palla_and_sunflower_evse', 'status') }}"

Thank you fior any help.

Remove this line:

       unit_of_measurement: ''

Thank you!
That worked!!

1 Like

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.