I have been trying to create a MT6701 (i2c version) . My config yaml validates, the compile works, it installs, but I see no indication that the code is ever activated. I have 4 sensors; the MT6701, a pulse meter, and temperature and humidity sensors from a DHT.
Looking at the esp log I see the dump of the configs for the pulse meter and the DHT sensors, I also see various messages from those same sensors. What I dont see is anything from the MT6701.
It is like the code is never called.
t
external_components:
- source:
type: local
path: my_components
i2c:
- id: i2c_mt6701
scl: GPIO21
sda: GPIO22
scan: false
frequency: 100kHz
# Enable logging
logger:
level: VERY_VERBOSE
sensor:
- platform: mt6701
i2c_id: i2c_mt6701
address: 0x06
wind_direction_degrees:
name: Wind Direction
id: wind_direction
force_update: true
update_interval: 2s
- platform: pulse_meter
device_class:
wind_speed
state_class:
measurement
pin:
number: GPIO14
mode: INPUT_PULLUP
unit_of_measurement: 'km/h'
name: windspeed
icon: 'mdi:weather-windy'
internal_filter: 13us
timeout: 10s
filters:
- lambda: >-
if (x < 1) return {};
return x * 0.119 -0.967;
- platform: dht
pin: GPIO18
model: rht03
temperature:
name: "Temperature"
humidity:
name: "Humidity"
update_interval: 30s
sensor.py
import esphome.codegen as cg
from esphome.components import i2c, sensor
import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
CONF_PIN,
CONF_WIND_DIRECTION_DEGREES,
ICON_SIGN_DIRECTION,
ICON_WEATHER_WINDY,
STATE_CLASS_MEASUREMENT,
UNIT_DEGREES,
CONF_NAME,
)
AUTO_LOAD = [
"sensor",
]
CODEOWNERS = ["@esphome/core"]
DEPENDENCIES = ["i2c"]
mt6701_ns = cg.esphome_ns.namespace("mt6701")
MT6701Component = mt6701_ns.class_("MT6701Component", sensor.Sensor, cg.PollingComponent, i2c.I2CDevice)
CONFIG_SCHEMA = (
cv.Schema(
{
cv.GenerateID(): cv.declare_id(MT6701Component),
cv.Required(CONF_WIND_DIRECTION_DEGREES): sensor.sensor_schema(
unit_of_measurement=UNIT_DEGREES,
accuracy_decimals=1,
icon=ICON_SIGN_DIRECTION,
state_class=STATE_CLASS_MEASUREMENT,
),
}
).extend(cv.polling_component_schema("2s"))
.extend(i2c.i2c_device_schema(default_address=0x06))
)
async def to_code_base(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
await i2c.register_i2c_device(var, config)
sens = await sensor.new_sensor(config[CONF_WIND_DIRECTION_DEGREES])
cg.add(var.set_wind_direction_degrees_sensor(sens))
return var
[14:30:04][C][logger:177]: Logger:
[14:30:04][C][logger:178]: Max Level: VERY_VERBOSE
[14:30:04][C][logger:179]: Initial Level: VERY_VERBOSE
[14:30:04][C][logger:181]: Log Baud Rate: 115200
[14:30:04][C][logger:182]: Hardware UART: UART0
[14:30:04][C][i2c.arduino:071]: I2C Bus:
[14:30:04][C][i2c.arduino:072]: SDA Pin: GPIO22
[14:30:04][C][i2c.arduino:073]: SCL Pin: GPIO21
[14:30:04][C][i2c.arduino:074]: Frequency: 100000 Hz
[14:30:04][C][i2c.arduino:086]: Recovery: bus successfully recovered
[14:30:04][C][pulse_meter:110]: Pulse Meter 'windspeed'
[14:30:04][C][pulse_meter:110]: Device Class: 'wind_speed'
[14:30:04][C][pulse_meter:110]: State Class: 'measurement'
[14:30:04][C][pulse_meter:110]: Unit of Measurement: 'km/h'
[14:30:04][C][pulse_meter:110]: Accuracy Decimals: 2
[14:30:04][C][pulse_meter:110]: Icon: 'mdi:weather-windy'
[14:30:04][C][pulse_meter:111]: Pin: GPIO14
[14:30:04][C][pulse_meter:113]: Filtering rising edges less than 13 µs apart
[14:30:04][C][pulse_meter:118]: Assuming 0 pulses/min after not receiving a pulse for 10s
[14:30:04][C][dht:017]: DHT:
[14:30:04][C][dht:018]: Pin: GPIO18
[14:30:04][C][dht:024]: Model: DHT22 (or equivalent)
[14:30:04][C][dht:026]: Internal Pull-up: ON
[14:30:04][C][dht:028]: Update Interval: 30.0s
[14:30:04][C][dht:030]: Temperature 'Temperature'
[14:30:04][C][dht:030]: Device Class: 'temperature'
[14:30:04][C][dht:030]: State Class: 'measurement'
[14:30:04][C][dht:030]: Unit of Measurement: '°C'
[14:30:04][C][dht:030]: Accuracy Decimals: 1
[14:30:04][C][dht:031]: Humidity 'Humidity'
[14:30:04][C][dht:031]: Device Class: 'humidity'
[14:30:04][C][dht:031]: State Class: 'measurement'
[14:30:04][C][dht:031]: Unit of Measurement: '%'
[14:30:04][C][dht:031]: Accuracy Decimals: 0
[14:30:04][C][mdns:116]: mDNS:
[14:30:04][C][mdns:117]: Hostname: esphome-web-a7f148
[14:30:04][V][mdns:118]: Services:
[14:30:04][V][mdns:120]: - _esphomelib, _tcp, 6053
[14:30:04][V][mdns:122]: TXT: friendly_name = ESPHome Web a7f148
[14:30:04][V][mdns:122]: TXT: version = 2025.4.2
[14:30:04][V][mdns:122]: TXT: mac = d4d4dae4cd2c
[14:30:04][V][mdns:122]: TXT: platform = ESP32
[14:30:04][V][mdns:122]: TXT: board = esp32dev
[14:30:04][V][mdns:122]: TXT: network = wifi
[14:30:04][C][esphome.ota:073]: Over-The-Air updates:
[14:30:04][C][esphome.ota:074]: Address: 10.0.0.89:3232
[14:30:04][C][esphome.ota:075]: Version: 2
[14:30:04][C][safe_mode:018]: Safe Mode:
[14:30:04][C][safe_mode:020]: Boot considered successful after 60 seconds
[14:30:04][C][safe_mode:021]: Invoke after 10 boot attempts
[14:30:04][C][safe_mode:023]: Remain in safe mode for 300 seconds
[14:30:04][C][api:140]: API Server:
[14:30:04][C][api:141]: Address: 10.0.0.89:6053
[14:30:04][C][api:145]: Using noise encryption: NO
[14:30:05][V][pulse_meter:079]: New pulse, delta: 2491099 µs, count: 1, width: 2491099.00000 µs
[14:30:05][V][sensor:043]: 'windspeed': Received new state 24.085754
[14:30:05][VV][sensor.filter:014]: Filter(0x3ffb2a60)::input(24.085754)
[14:30:05][VV][sensor.filter:286]: LambdaFilter(0x3ffb2a60)::new_value(24.085754) -> 1.899205
[14:30:05][VV][sensor.filter:021]: Filter(0x3ffb2a60)::output(1.899205) -> SENSOR
[14:30:05][D][sensor:094]: 'windspeed': Sending state 1.89920 km/h with 2 decimals of accuracy
[14:30:05][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
[14:30:05] key: 1726592700
[14:30:05] state: 1.8992
[14:30:05] missing_state: NO
[14:30:05]}
[14:30:05][W][component:239]: Component pulse_meter.sensor took a long time for an operation (59 ms).
[14:30:05][W][component:240]: Components should block for at most 30 ms.
[14:30:06][VV][dht:191]: Data: Hum=0b0000001111100111, Temp=0b0000000010001111, Checksum=0b01111001
[14:30:06][D][dht:049]: Got Temperature=14.3°C Humidity=99.9%
[14:30:06][V][sensor:043]: 'Temperature': Received new state 14.300000
[14:30:06][D][sensor:094]: 'Temperature': Sending state 14.30000 °C with 1 decimals of accuracy
[14:30:06][VV][api.service:140]: send_sensor_state_response: SensorStateResponse