From the ESPHome components page, I’m trying to install my MMC5603 Magnetometer. I’ve taken the sensor configuration entry and added it to my device .yaml script. When I go to install it, I get the message, “Platform not found: ‘sensor.MMC5603’.”
It seems I’m missing something, but I’m at a loss as to how to fix it. I tried updating my install of Home Assistant in the hope that it wasn’t in my original install. I believe I’ve done that correctly but it hasn’t helped.
In poking around my Home Assistant install, I’ve found other components that I’ve used at /usr/local/lib/python3.10/dist-packages/esphome/components/ . However, I did not see an entry for mmc5603.
My install of Home Assistant and ESPHome is not an out-of-the-box install. I’ve got it installed on Ubuntu. I don’t have an “Add-ons” selection the settings. Is there a way of updating ESPHome via Linux command line?
Everything before “captive_portal” is automatically created. With it I’m able to connect via wifi, etc. Everything after that is from the ESPHome page regarding the MMC5603.
Everything after “sensor:” is underlined in red notating an error. When I hover over anything red-lined, I see the error message in the title, “Platform not found: ‘sensor.MMC5603’”. When I try to install, it does not compile.
esphome:
name: mmc5603-magnetometer
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
#
# Network info left out for brevity
#
captive_portal:
sensor:
- platform: MMC5603
address: 0x30
field_strength_x:
name: "MMC5603 Field Strength X"
field_strength_y:
name: "MMC5603 Field Strength Y"
field_strength_z:
name: "MMC5603 Field Strength Z"
heading:
name: "MMC5603 Heading"
update_interval: 60s
This appears to be something in my setup. I’ve been looking at what’s needed to set up a custom sensor. I found the .cpp and .h code in the ESPHome source repository (ESPHome: /opt/build/esphome/esphome/components/mmc5603 Directory Reference) and I tried creating an mmc6503 folder in my ESPHome file structure and putting those files in it. I’m not clear on what’s needed to register the component in ESPHome so that when it sees my .yaml declaration it knows what to do and where those files exist.
Don’t know why you would set up a custom component, but perhaps you have the wrong framework. As the docs say, ESP-IDF is preferred for esp32c3, and in any event the c3 is still in development. All on this page:
ESP-IDF framework
This is an alternative base framework for ESP32 chips, and recommended for variants of the ESP32 like ESP32S2, ESP32S3, ESP32C3 and single-core ESP32 chips.
Note
Support for the ESP32-S2 and ESP32-C3 is still in development and there could be issues.
I didn’t know ESP-IDF existed. I’ve successfully used a BME280 pressure, temperature and humidity sensor with this setup so I figured I’d push further and try the magnetometer.
I’m not really trying to use a custom component. I’m just trying to figure out what tells ESPHome that I’ve got code for a component, i.e. mmc5603.cpp and .h. I figured that was one way to do it. If you know of a better way please let me know. Is it possible that the MMC5603 support is only in beta and not the stable release?