diff --git a/esphome/components/template/binary_sensor/template_binary_sensor.cpp b/esphome/components/template/binary_sensor/template_binary_sensor.cpp index 25879f876d..806aed49b1 100644 --- a/esphome/components/template/binary_sensor/template_binary_sensor.cpp +++ b/esphome/components/template/binary_sensor/template_binary_sensor.cpp @@ -7,9 +7,11 @@ namespace template_ { static const char *const TAG = "template.binary_sensor"; void TemplateBinarySensor::setup() { - if (!this->f_.has_value()) + if (!this->f_.has_value()) { this->disable_loop(); - this->loop(); + } else { + this->loop(); + } } void TemplateBinarySensor::loop() {