First integration: one entity with attributes or multiple entities

Hello - I’m trying to create my first Home Assistant integration. Apologies if this isn’t the right forum for these types of questions - feel free to point me somewhere else if that’s the case.

My electric utility has a “time of use” plan that changes rates / modes depending on the season and time of day. With Home Assistants recent endeavor into energy management, I wanted to create an integration that provided the current electric rate ($/kWh) as well as other entities so that automations can be performed as the electric rate goes in and out of various modes (turn off AC, turn off outlets etc).
Note: I’m aware I can create these with template sensors etc in configuration.yaml - and I already have. I’m creating this because the Jinja template was tedious for these sensors, and potentially other users with the same utility provider can install this and get the information easily.

So far I think I am on track to be able to provide sensors like electric season / rate / mode - my question is more around the philosophy of creating an integration:

Should I create 1 entity that has a bunch of attributes (like season: summer, rate: 0.09, mode: peak) … or should I create individual sensors for each one of these attributes? Or have 1 big entity with all the state attributes as well as individual sensors for each attribute? Is it just a matter of preference?

Happy to provide more information if that would help - thanks!

Have you had any traction on this or others interested. I have Dominion as well with a smart meter and definitely interested in seeing how I can either integrate in with my current smart meter, or be able to automatically import in.

1 Like