HA mqtt discovery corrections

#393
add value template definition when missing and correct wrong payloads
This commit is contained in:
1technophile committed 2019-05-04 21:52:17 +02:00
1 parent 255ac7ddde
commit d3f345f944
1 file changed
+3 -3
+3 -3
View File
@@ -138,7 +138,7 @@ void pubMqttDiscovery()
#ifdef ZsensorHCSR501
trc(F("HCSR501Discovery"));
char * HCSR501sensor[8] = {"binary_sensor", "hcsr501", "hcsr501", "","","true", "false", ""};
char * HCSR501sensor[8] = {"binary_sensor", "hcsr501", "hcsr501", "","{{value_json.hcsr501}}","true", "false", ""};
//component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement
trc(F("CreateDiscoverySensor"));
@@ -152,7 +152,7 @@ void pubMqttDiscovery()
#ifdef ZsensorGPIOInput
trc(F("GPIOInputDiscovery"));
char * GPIOInputsensor[8] = {"binary_sensor", "GPIOInput", "GPIOInput", "","","true", "false", ""};
char * GPIOInputsensor[8] = {"binary_sensor", "GPIOInput", "GPIOInput", "","{{value_json.gpio}}","HIGH", "LOW", ""};
//component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement
trc(F("CreateDiscoverySensor"));
@@ -338,7 +338,7 @@ void pubMqttDiscovery()
#ifdef ZgatewayBT
// Sensor to display BT received value
trc(F("gatewayBTDiscovery"));
char * gatewayBT[8] = {"sensor", "gatewayBT", "", "","{{ value_json.message }}","", "", ""};
char * gatewayBT[8] = {"sensor", "gatewayBT", "", "","{{ value_json.id }}","", "", ""};
//component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement
trc(F("CreateDiscoverySensor"));