Adding custom attributes to entity subclasses

I’m writing a custom integration for some custom hardware I’ve made. I can give more details but I don’t think they’re terribly important to the meat of this question.

In the custom integration, I am subclassing ClimateEntity, implementing the entity, and then loading the platform following the example - all of that is working great.

The problem is, my hardware has some added things that it can do that aren’t really represented in the attributes of a ClimateEntity. E.g., there’s multiple temperature sensors, additional directionality to the fan, etc.

It would be easy enough for me to implement this by just adding a few new attributes to the entity that are not part of the base ClimateEntity. However, I cannot for the life of me figure out how one adds new attributes. I tried adding properties, and they exist in Python but never show up in the home assistant UI. And I don’t really see anywhere obvious that shows how to expose new attributes to home assistant’s state machine. Can anyone give me some pointers?

You cant just add new attributes or properties to an entity and expect them to show up as the frontend does not know about these or how to display them.

You would need to create additional entities like sensors or switches (if they can be controlled) etc for these additional functions and then they would show in the UI. You tie them all together by making part of the same device entry.

There is not always the perfect answer to some of these functions but the combinations of different entities to make up all the device sensors and functions wrapped under a single device is how HA does it

Add them to extra_state_attributes property or use the _attr_extra_state_attribute shorthand attribute and they will be added to the state’s attributes.
You can them display them using an entity card or something as such that can show attributes.

However as already mentioned it would likely be preferred to have them as sensors instead but given it’s your own creation you can do as you prefer.