WTH can't we make "fake" entities with custom properties?

Hey everyone

So I was wondering WTH we can’t “make” custom entities. As an example, I made myself an ESPHome device to control my split system air con. It can change the temp, fan speed, on/off status, heating/cooling mode etc using the ESP I made. However, I can’t use the thermostat card because it’s not a climate entity. Even though it does all the same things as a climate entity, it’s not one.

It would be great if we could make custom entities with custom properties. For example, we could say that for my custom thermostat, the temperature is given by my ESPHome sensor’s temperature reading. The function to change temperature is given by my ESPHome function etc. Once it’s all done, it makes an entity that can be used with cards. I know there’s the generic thermostat, but it’s specific to a thermostat, which I don’t have (i.e. it’s looking for a switch entity specifically in order to change the heating/cooling mode rather than an ESPHome function).

I ended up finding something through HACS that works as a generic climate entity, but it would be good to have this as part of HA natively for any entity that we want to map. It could even be a new type of helper called “Entity”, which we can then choose what entity we want to map

Thanks for listening!

Have you tried ?

I have, but like I said, that’s a thermostat specifically. Since this is a split system air con, there’s no way to map all the features of my split system to the generic thermostat. Also the thermostat needs things like a temperature sensor for the room, which I don’t have. It also specifically needs a switch entity to turn the aircon/heater on/off when the target temperature is reached, which is an issue because for a split system there’s no target temperature, and there’s no need to physically turn it on/off when the temperature is reached since it handles that all automatically.

To be fair, what you are describing already exists* inside of HA. It’s called a template entity. There are many different types of entities you can create:

  • But also it seems the one thing that you are asking for (climate) isn’t provided for in the template entity schema. You should probably post a FR for a template climate entity.

As mentioned above, you could use templating to create a template, however that can be quite advanced, so if you are instead asking for a simpler way to add a “Generic HVAC” as a virtual HVAC device via the UI then check out this this idea of adding more “generic” integrations built-into Home Assistant so would not need to build templates yourself → WTH not add more native "generic" integrations built-into Home Assistant core to create virtual devices (like Generic Thermostat, Generic Hygrostat, and Generic Camera)?

I know this question is about more than thermostats, but I believe @finity has answered that.

Regarding the thermostat… If you want a climate entity, why not configure one on the ESPHome device?

1 Like

If your using ESPHome, then you should define climate in the esp itself:

https://esphome.io/components/climate/index.html

This is my config for a midea ac unit:

climate:
  - platform: midea
    name: Klimatyzacja dol      # Use a unique name.
    period: 1s                  # Optional
    timeout: 2s                 # Optional
    num_attempts: 3             # Optional
    autoconf: true              # Autoconfigure most options.
    beeper: false               # Beep on commands.
    visual:                     # Optional. Example of visual settings override.
      min_temperature: 17 °C    # min: 17
      max_temperature: 30 °C    # max: 30
      temperature_step: 0.5 °C  # min: 0.5
    supported_modes:            # All capabilities in this section detected by autoconf.
      - FAN_ONLY                # This capability is always used.
      - HEAT_COOL
      - COOL
      - HEAT
      - DRY
    custom_fan_modes:
      - SILENT
      - TURBO
    supported_presets:          # All capabilities in this section detected by autoconf.
      - ECO
      - BOOST
      - SLEEP                   # This capability is always used.
    custom_presets:             # All capabilities in this section detected by autoconf.
      - FREEZE_PROTECTION
    supported_swing_modes:
      - VERTICAL                # This capability is always used.
      - HORIZONTAL
      - BOTH
    outdoor_temperature:        # Optional. Outdoor temperature sensor (may display)
      name: Temp
    power_usage:                # Optional. Power usage sensor (only for devices that support this feature).
      name: Power
    humidity_setpoint:          # Optional. Indoor humidity sensor (only for devices that support this feature).
      name: Humidity
3 Likes

I use Node Red for such things.
It circumvent some of the limitations set inside HA.

It was a while ago I set up my ESPHome but from memory I wasn’t able to set up a climate and had to manually read and set up the various IR codes to make it work, but it was ages ago so I might be misremembering. As for the template, it does seem to do that for other entities, but I wonder if there’s any other entity types that might be worth adding in as well?