diff --git a/ZmqttDiscovery.ino b/ZmqttDiscovery.ino index 63506ef..183eb3d 100644 --- a/ZmqttDiscovery.ino +++ b/ZmqttDiscovery.ino @@ -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"));