From 3795667f36ac339b013b4039263830889968d685 Mon Sep 17 00:00:00 2001 From: Adrian Scillato <35405447+ascillato@users.noreply.github.com> Date: Fri, 14 Dec 2018 23:57:12 -0300 Subject: [PATCH] Fix HomeAssistant Temp Sensor AutoDiscovery https://github.com/arendst/Sonoff-Tasmota/issues/4627 --- sonoff/xdrv_12_home_assistant.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/xdrv_12_home_assistant.ino b/sonoff/xdrv_12_home_assistant.ino index 20c2a9038..ad9e71a4c 100644 --- a/sonoff/xdrv_12_home_assistant.ino +++ b/sonoff/xdrv_12_home_assistant.ino @@ -458,7 +458,7 @@ void HAssAnnounceSensor(const char* sensorname, const char* subsensortype) } snprintf_P(mqtt_data, sizeof(mqtt_data), Settings.flag3.hass_short_discovery_msg?HASS_DISCOVER_SENSOR_SHORT:HASS_DISCOVER_SENSOR, name, state_topic, availability_topic); - if (!strcmp_P(subsensortype, PSTR(D_JSON_HUMIDITY))) { + if (!strcmp_P(subsensortype, PSTR(D_JSON_TEMPERATURE))) { snprintf_P(mqtt_data, sizeof(mqtt_data), Settings.flag3.hass_short_discovery_msg?HASS_DISCOVER_SENSOR_TEMP_SHORT:HASS_DISCOVER_SENSOR_TEMP, mqtt_data, TempUnit(), sensorname); } else if (!strcmp_P(subsensortype, PSTR(D_JSON_HUMIDITY))) {