HA Generic Thermostat Value From ESPHOME

hello all.
i have a generic thermostat in HA. and i want to read the temperature setpoint value from esphome. since generic thermostat setpoint is not an entity, i dont know how to do read it.

thank you for the help

Generic thermostat : Generic Thermostat - Home Assistant

There is no hassio, there hasn’t been for over a year now.

What exactly are you trying to do? Make a climate integration in home assistant or in esphome?

hi. i have a generic thermostat in HA. and i want to read the temperature setpoint value from esphome. since generic thermostat setpoint is not an entity, i dont know how to do read it.

many thanks

Set target_temperature in the generic thermostat.

could you solve it?

Set up a template sensor to read the attribute value:

template:
  - sensor:
      - name: "Central heating target temperature"
        unit_of_measurement: '°C'
        device_class: temperature
        state: "{{ state_attr('climate.central_heating', 'temperature') }}"

then refer to it in your ESPHome YAML:

sensor:
  - platform: homeassistant
    name: "Target CH temperature"
    entity_id: sensor.central_heating_target_temperature
    id: target_temp
    internal: true

thank you ver much!

Thanks bro