Extract attribute into new sensor entity

I have had this code in config for some time, extracting an attribute into a new sensor entity:

>   sensor:
      - platform: attributes
        friendly_name: "Ecobee Heat"
        entities: 
          - climate.upstairs
        attribute: hvac_action

Upon upgrading to 2023.6, it creates an error in the config and does not pass the config check test any longer.

Did i miss a breaking change ? :slight_smile:

What is the proper way to extract this attribute into a new sensor entity ?

Thanks in advance !

There has never been a core attributes sensor platform, are you using a third party integration for this?

Or did you use Chat GPT to generate it?

It looks like Chat GPT gibberish.

Either way, to do it correctly put this in your configuration.yaml file:

template:
  - sensor:
      - name: Ecobee Heat
        state: "{{ state_attr('climate.upstairs', 'hvac_action') }}"
1 Like

Thank you @tom_l !

1 Like

@tom_l : figured out where the code came from : custom integration in HACS. The reason for the new error after upgrading to 2023.6 is that the Integration also needed to be updated.

Still, your proposed way is cleaner, thank you.

2 Likes