Any way to create custom entities and/or entity platforms?

Hello everyone,

I’ve been trying to create some entities to monitor my hardware.
Ideally I would like to create a platform called gpu and assign sensors as attributes to each entity.

something like this:
entity_id: gpu.name_1

Then add attributes from sensors i have imported into HA.

As gpu.name_1.attributes.temperature i would like to assign the value of sensor.gpu_1_temp that i have already imported in home assistant.

I hope I’m making sense…
Is there some way to work this thing out?

That’s not the domain, it’s the platform.
Domain is “hue”,"'mqtt", “spotify”, … i.e. the integration.
Platform is “sensor”, “switch”, “light”, …

But no, there is no way to create a new platform without digging inside HA code.
Not that it makes much sense besides cosmetics, tbh.

Right, platform. I’ll edit it, thank you.

The platform was an aesthetic request indeed, i wouldn’t mind working with sensor platform.
But could i add extra templatable attributes to a sensor at least?

edit:
Something like:

sensor:
  - platform: template
    sensors:
      gpu_1:
        value_template: '{{something here}}'
        friendly_name: "name"
        #and then add more stuff like:
        temperature: "{{states.sensor.gpu_1_temp.state}}"
        load: "{{states.sensor.gpu_1_load.state}}"

This way i could tidy up everything in my new custom sensor and call them by
{{states.sensor.gpu_1.attributes['load']}}

And perhaps add a unit of measurement into every attribute? :smiley:

See Template - Home Assistant (home-assistant.io) for sample of having template attributes

Looks like that is the way, managed to create one :slight_smile:
image
Any clue on if/how i can add a unit of measurement to each attribute?

Unit of measurement only applies to values, not attributes.

got it! :+1: