HA mqtt discovery corrections
#393 add value template definition when missing and correct wrong payloads
This commit is contained in:
1 parent
255ac7ddde
commit
d3f345f944
1 file changed
+3
-3
+3
-3
@@ -138,7 +138,7 @@ void pubMqttDiscovery()
|
|||||||
|
|
||||||
#ifdef ZsensorHCSR501
|
#ifdef ZsensorHCSR501
|
||||||
trc(F("HCSR501Discovery"));
|
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
|
//component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement
|
||||||
|
|
||||||
trc(F("CreateDiscoverySensor"));
|
trc(F("CreateDiscoverySensor"));
|
||||||
@@ -152,7 +152,7 @@ void pubMqttDiscovery()
|
|||||||
|
|
||||||
#ifdef ZsensorGPIOInput
|
#ifdef ZsensorGPIOInput
|
||||||
trc(F("GPIOInputDiscovery"));
|
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
|
//component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement
|
||||||
|
|
||||||
trc(F("CreateDiscoverySensor"));
|
trc(F("CreateDiscoverySensor"));
|
||||||
@@ -338,7 +338,7 @@ void pubMqttDiscovery()
|
|||||||
#ifdef ZgatewayBT
|
#ifdef ZgatewayBT
|
||||||
// Sensor to display BT received value
|
// Sensor to display BT received value
|
||||||
trc(F("gatewayBTDiscovery"));
|
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
|
//component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement
|
||||||
|
|
||||||
trc(F("CreateDiscoverySensor"));
|
trc(F("CreateDiscoverySensor"));
|
||||||
|
|||||||
Reference in new issue
Block a user