diff --git a/main/ZmqttDiscovery.ino b/main/ZmqttDiscovery.ino index 59d4546..93cf17c 100644 --- a/main/ZmqttDiscovery.ino +++ b/main/ZmqttDiscovery.ino @@ -479,7 +479,7 @@ void pubMqttDiscovery() { # ifdef ZsensorGPIOInput Log.trace(F("GPIOInputDiscovery" CR)); - char* GPIOInputsensor[8] = {"binary_sensor", "GPIOInput", "", "", jsonGpio, "HIGH", "LOW", ""}; + char* GPIOInputsensor[8] = {"binary_sensor", "GPIOInput", "", "", jsonGpio, INPUT_GPIO_ON_VALUE, INPUT_GPIO_OFF_VALUE, ""}; //component type,name,availability topic,device class,value template,payload on, payload off, unit of measurement Log.trace(F("CreateDiscoverySensor" CR)); diff --git a/main/config_GPIOInput.h b/main/config_GPIOInput.h index 56e293f..b7dce13 100644 --- a/main/config_GPIOInput.h +++ b/main/config_GPIOInput.h @@ -42,4 +42,7 @@ extern void GPIOInputtoMQTT(); # endif #endif +#define INPUT_GPIO_ON_VALUE "HIGH" +#define INPUT_GPIO_OFF_VALUE "LOW" + #endif