esphome/feature-requests

HX711 via I2C (m5stack)

PineappleEmperor opened this issue · 7 comments

Describe the problem you have/What new integration you would like
Support HX711 sensors via I2C.

Please describe your use case for this integration and alternatives you've tried:
I currently use a lot of m5stack ESP32 gear, and would like to use the m5stack HX711 (along with other sensors) which uses I2C. At present, the HX711 sensor requires dout_pin and clk_pin. I've looked to see if I can directly use arduino code, but this is a messy workaround and I'd prefer to keep to native ESPHome if possible.

Additional context
I'm new (and very amateur) with ESPHome, so if I'm missing something obvious please let me know!

same here

Bump. Just got this thing and am getting into making it work.

FWIW, I managed to get the M5 Atom stack to return a value by following this video: https://www.youtube.com/watch?v=GlIS2HsSdWY

The only difference I can tell from my original attempt was that I flashed ESP Home to the device using the https://web.esphome.io/ website instead of the HAOS add-in.

I haven't calibrated it yet, so I may yet run into issues, but here's the YAML that is currently working. I haven't bothered to clean it up yet.

substitutions:
name: esphome-web-a03858
friendly_name: Aeroponica-Scale1

esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
project:
name: esphome.web
version: dev

esp32:
board: esp32dev
framework:
type: arduino

Enable logging

logger:

Enable Home Assistant API

api:

Allow Over-The-Air updates

ota:

  • platform: esphome

Allow provisioning Wi-Fi via serial

improv_serial:

wifi:

Set up a wifi access point

ap: {}

In combination with the ap this allows the user

to provision wifi credentials to the device via WiFi AP.

captive_portal:

dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
import_full_config: true

Sets up Bluetooth LE (Only on ESP32) to allow the user

to provision wifi credentials to the device.

esp32_improv:
authorizer: none

To have a "next url" for improv serial

web_server:
port: 80

sensor:

  • platform: hx711
    name: "HX711 Value"
    dout_pin: GPIO32
    clk_pin: GPIO26
    gain: 128
    update_interval: 60s

If that's working for you then you're not using a i2c device.

I believe we're referring to this one:
https://shop.m5stack.com/products/mini-scales-unit-hx711

From chatting with the devs, this would require code changes to ESPHome.

I believe we're referring to this one:

https://shop.m5stack.com/products/mini-scales-unit-hx711

From chatting with the devs, this would require code changes to ESPHome.

Yeah that's the one I was referring to. I had assumed the hx711 component would need changing, but similar to other components that can be used with I2C OR direct pins?