Generic Thermostat question

Hey Guys

I have a question about the generic thermostat. I have a temperature sensor hooked up to my Arduino and pushing data over MQTT, and this is working fine. I’ve defined a sensor as well and that also seems to be working fine.
However, I’ve defined a generic thermostat and it’s not displaying the current temperature. On the generic thermostat page it says “target_sensor (Required): entity_id for a temperature sensor, target_sensor.state must be temperature” I’m not sure what the target_sensor.state is and how to define it, and if that’s what’s missing from enabling the generic thermostat to read the current value.

My config block looks like this:

platform: generic_thermostat
name: Livingroom
heater: switch.heater
target_sensor: sensor.livingroom_temp_sensor
min_temp: 15
max_temp: 27
target_temp: 24
min_cycle_duration:
minutes: 10

Thanks,
Eric

What is the code you use to define sensor.livingroom_temp_sensor? What is in the json statement contained within the mqqt entry?

  • platform: mqtt
    state_topic: “arduino/living_room/temperature”
    name: “Livingroom Temp Sensor”
    unit_of_measurement: “°C”

value_template: ‘{{ value_json.temperature }}’

I’ve tried formatting the data like this

{“temperature”: 25}
{“temperature”: “25”}
and right now it’s just the number, no json

So I’ve been looking at the logs, and I’m getting

homeassistant.components.climate.generic_thermostat: Unable to update from sensor: could not convert string to float: ‘27.55\x00’