WTH are attributes such a pain to work with

Good/interesting point:

  • @pnbruckner’s Sun2 integration is very useful and was one of the first custom integrations I installed at least 2 years ago.
  • The Sun2 integration is fairly old and could stand to be upgraded to take advantage of some of the modern elements of Home Assistant. For example, Sun2 adds a bunch of entities that don’t have any info available through the UI about what integration they belong to. i.e. Where did sensor.daylight come from?
  • Sun2 entities don’t have any consistent naming that can be used to search to see what might be related.
  • Since sun2 is a custom integration, there is no data on how many people use it in Integrations | Home Assistant Analytics
  • It would be nice to see some features of Sun2 make it into the sun integration so less people need to install a custom integration. (Of course data could help drive that decision.)
  • A number of the Sun2 entities actually make extensive use of attributes. For example sensor.daylight:

image

Actually the climate set point (to me) is a great example of an attribute that should be an entity. It is first data that to relate to and use in automation. When did it last change? How long did it take for the observed temperature to catch up? What’s the difference between specific rooms and the set point for the HVAC system.

So back to the topic at hand. Attributes are probably going to be around for a while. I have a lot of template sensors (many in legacy format that need to be converted so they can be used It in statistics. It would be help the UX if there were some tools to make the usage easier. I think there are some other WTHs that are related:

If there are going to be breaking changes (attributes → entities) then it would be good to have some assistance to deal with refactoring and merging history.

Also if the number entities is going to be increasing as attributes start to become somewhat deprecated:

Not sure if this helps, but I think it helps to take a little bit of a broader look at the implications of Home Assistant as a home data platform. I think these things will become more important over time as Home Assistant is used for managing costs, energy being the largest, and doing more to protect property (spot things that need attention because they are out of bounds, don’t follow trends, etc.)

2 Likes