Return States showing as undefined

Trying to make new room cards and running into this issue when trying to add temp and humidity to the card my code is as follows


      - type: custom:button-card
        name: Living Room
        icon: mdi:sofa
        entity: sensor.kitchen_temperature_2
        show_state: false
        custom_fields:
          temp: >
            [[[ return states['sensor.bedroom_thermometer_temperature'].stat +'°F' ]]]
          hum: >
            [[[ return states['sensor.living_room_thermometer_humidity'].stat + '%']]]

It shows up on card but as undefined F and undefined %. The sensors are working and outputting data just not onto the card. Any help would be greatly appeciated thank you

Uhh, what is the [[[ and ]]] expected to do? That certainly is not a standard Jinja template. Run Python or JavaScript or…?

It’s .state, not .stat.

It’s JS. See the custom button card docs.