Mqtt Autodiscover Range value input/output

Hi All,
I have a couple of wifi/mqtt-thermostats and want to control them with HA.
They are accessible through MQTT and I wanted to add them through MQTT Autodiscover to my HA.
I’ve already managed to get the actual temperature with an sensor.
However, I can not figure out how to create a entity that is able to send/receive the value (similar to light-brightness / similar to node-red’s slider control).

This is what I send for the sensor (works fine)

topic: homeassistant/sensor/myCustomDeviceId/config
"payload": {
	"name": "Esszimmer",
	"device_class": "temperature",
	"unit_of_measurement": "°C",
	"value_template": "{{ value[1:3] | int(value[1:3],16)/2 }}",
	"state_topic": "thermostat/myCustomDeviceId/Set/A0",
	"unique_id":"myCustomDeviceId"
};

Thank you,
Andreas

You have chosen to model your thermostat as an MQTT Sensor. You should consider modeling it as MQTT HVAC.

@123, Thank you. I probably don’t quite get it correctly, but isn’t there a way to set the temperature directly? or is hvac limited to control modes?

You could create an input_number. It appears as a slider in the Lovelace UI. Then you would need to create an automation that monitors the input_slider’s value and publishes it to your desired MQTT topic.

Or you could use MQTT HVAC which combines the MQTT temperature sensor you have created, a means to control the temperature, and much more, all in one integration.

I’m not able to control the devices directly, but I have added a nodejs layer in between and now it works ok. Thank you

1 Like