Define a device in the template configuration

Much like manually defined MQTT entities, one should be able to define the device to which a template entity belongs.

Here is an example of something that I just created:

mqtt:
  climate:
    - device:
        identifiers: ["house.air_conditioner"]
        name: Air Conditioner
        manufacturer: Daikin Industries, Ltd.
        model: FTXA35BS
      name: Thermostat
      ... # Other configurations here
 
template:
  - sensor:
      - name: "Air Conditioner Current Temperature"
        state: "{{ state_attr('climate.air_conditioner', 'current_temperature') }}"
        unit_of_measurement: "°C"
        device_class: "temperature"

        # This is the feature request: the ability to set the entity's device.
        # As of now, this will not work (do not try at home).
        device:
          identifiers: ["house.air_conditioner"]

This would allow for adding template entities to devices, grouping them all together.

The same syntax proposed for the MQTT integration could be used:

I think this is the same thing…
Should vote there I think…

Add Template Sensors to Device page - #21 by schneich.

You’re right. I’ve moved the details of my request there and voted for it. Thanks for pointing it out.

1 Like