02-02-2025, 12:44 PM
A note for people using the HA YAML, you can get better information on temperature/humidity data in HA if you provide it with a better description of what the sensors are:
Code:
mqtt:
sensor:
- name: kc868_temperature_1
unique_id: uniqueid__kc868_temperature_1
icon: mdi:thermometer
state_topic: "KC868_A16/1234ABCD/STATE"
value_template: "{{ value_json.sensor1.temperature }}"
unit_of_measurement: "°C"
device_class: temperature
# Note that the docs misspell this as "humity", it's actually returned
# as "humidity".
- name: kc868_humidity_1
unique_id: uniqueid__kc868_humidity_1
icon: mdi:water-percent
state_topic: "KC868_A16/1234ABCD/STATE"
value_template: "{{ value_json.sensor1.humidity }}"
unit_of_measurement: "%"
device_class: humidity
homeassistant:
customize:
sensor.kc868_temperature_1:
friendly_name: "Temperature"
sensor.kc868_humidity_1:
friendly_name: "Humidity"