Repository navigation
Add M5Stack Dial Templates #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,6 +197,7 @@ | |
| "reflash", | ||
| "regen", | ||
| "resharper", | ||
| "RFID", | ||
| "rhysd", | ||
| "Rigol", | ||
| "RMII", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,270 @@ | ||
| # External usage: | ||
| # packages: | ||
| # device: github://ptr727/ESPHome-Config/templates/m5stack-dial.yaml@main | ||
| # - Secrets resolve from a secrets.yaml beside the including config, see secrets._yaml for the names. | ||
|
|
||
| # Required substitutions: | ||
| # - device_name - the ESPHome node name. | ||
| # - device_friendly_name - the Home Assistant display name. | ||
|
|
||
| # Optional substitutions: | ||
| # - backlight_brightness - 80%, the level the backlight turns on at during boot. | ||
| # - rgb_led_pin - GPIO21, the StampS3 module's RGB LED, used by rgb-led-status.yaml. | ||
|
|
||
| # M5Stack Dial ESP32-S3 Smart Rotary Knob, V1 on a StampS3, V1.1 on a StampS3A | ||
| # ESP32-S3FN8, 8MB Quad Flash, no PSRAM | ||
| # https://shop.m5stack.com/products/m5stack-dial-v1-1 | ||
| # https://docs.m5stack.com/en/core/Dial | ||
|
|
||
| # Board tested: 2026-10-24, a V1 on a StampS3, USB and OTA flash, display, touch, backlight, encoder, front button, buzzer, RTC write. | ||
| # - The RFID reader answers on the bus, and reading a tag is untested. | ||
| # - The power hold and the Power Off button are untested, since the bench unit ran on USB. | ||
| # - The BOOT button and the RGB LED sit inside the case, so neither is tested. | ||
| # - A V1.1 on a StampS3A is untested. | ||
|
|
||
| # The display, the touchscreen and the backlight are configured here. | ||
| # - The display carries no lambda, so a device draws with LVGL, see test/m5stack-dial.yaml. | ||
| # - A lambda device extends board_display with lambda, update_interval and auto_clear_enabled true instead. | ||
|
|
||
| # GPIO19, GPIO20 : native USB, so flashing needs no adapter and no UART bridge | ||
| # GPIO0 : BOOT button on the StampS3, held at power on for download mode | ||
| # GPIO3 : passive buzzer | ||
| # GPIO21 : RGB LED on the StampS3, inside the case | ||
| # GPIO40, GPIO41 : rotary encoder A and B | ||
| # GPIO42 : front button, pressing the whole screen down | ||
| # GPIO46 : power hold, see below | ||
|
|
||
| # Power hold | ||
| # - On battery the front button or the RTC alarm powers the board on, and the board stays on only while GPIO46 is high. | ||
| # - The Power Off button drives it low, which turns a board on battery off and does nothing on USB or the DC input. | ||
| # - A restart releases the pin until the switch sets up again, and whether a board on battery survives that is untested. | ||
| # - Battery level is not sensed, since no ADC pin reaches the battery. | ||
|
|
||
| # Internal I2C bus | ||
| # GPIO11 : sda | ||
| # GPIO12 : scl | ||
| # - 0x38 FT3267 touch, 0x51 BM8563 RTC, 0x28 WS1850S RFID reader. | ||
|
|
||
| # SPI bus, the LCD only | ||
| # GPIO6 : sclk | ||
| # GPIO5 : mosi | ||
| # GPIO4 : LCD dc | ||
| # GPIO7 : LCD cs | ||
| # GPIO8 : LCD reset, also wired to the WS1850S reset | ||
| # GPIO9 : LCD backlight, PWM | ||
|
|
||
| # GC9A01 240x240 round IPS, with an FT3267 touch panel | ||
| # GPIO14 : touch interrupt | ||
| # GPIO10 : WS1850S interrupt, unclaimed here | ||
|
|
||
| # Grove ports, left to the device | ||
| # Port A : GPIO13 sda, GPIO15 scl | ||
| # Port B : GPIO1, GPIO2 | ||
|
|
||
| # https://esphome.io/components/substitutions | ||
| substitutions: | ||
| backlight_brightness: 80% | ||
| # Used by rgb-led-status.yaml | ||
| rgb_led_pin: GPIO21 | ||
|
|
||
| # https://esphome.io/components/esphome | ||
| esphome: | ||
| name: ${device_name} | ||
| friendly_name: ${device_friendly_name} | ||
|
|
||
| # https://esphome.io/components/esphome#esphome-on_boot | ||
| on_boot: | ||
| - priority: 600 | ||
| then: | ||
| - light.turn_on: | ||
| id: lcd_backlight | ||
| brightness: ${backlight_brightness} | ||
|
|
||
| # The RTC sets the clock once at boot, so it never overwrites a network time source later. | ||
| - bm8563.read_time: rtc_time | ||
|
|
||
| # https://esphome.io/components/esp32 | ||
| esp32: | ||
| # PlatformIO carries no Dial or StampS3 board definition, and the DevKitC-1 profile matches the module. | ||
| # https://docs.platformio.org/en/latest/boards/espressif32/esp32-s3-devkitc-1.html | ||
| board: esp32-s3-devkitc-1 | ||
|
|
||
| # The board definition does not set this, ESPHome defaults to 4MB. | ||
| flash_size: 8MB | ||
|
|
||
| # https://esphome.io/components/esp32#esp-idf-framework | ||
| framework: | ||
| type: esp-idf | ||
|
|
||
| # https://esphome.io/components/packages#local-packages | ||
| packages: | ||
| common: !include common.yaml | ||
| temperature: !include temperature.yaml | ||
| rgbledstatus: !include rgb-led-status.yaml | ||
|
|
||
| # USB is the chip's own port, with no UART bridge on this board. | ||
| # https://esphome.io/components/logger | ||
| logger: | ||
| hardware_uart: USB_SERIAL_JTAG # UART0, UART1, USB_CDC, USB_SERIAL_JTAG | ||
|
|
||
| # A list entry rather than the mapping shorthand, so a device's own bus merges instead of replacing this. | ||
| # https://esphome.io/components/i2c | ||
| i2c: | ||
| - id: board_i2c | ||
| sda: GPIO11 | ||
| scl: GPIO12 | ||
| scan: true | ||
| frequency: 400kHz | ||
|
|
||
| # https://esphome.io/components/spi | ||
| spi: | ||
| - id: board_spi | ||
| clk_pin: GPIO6 | ||
| mosi_pin: GPIO5 | ||
|
|
||
| # https://esphome.io/components/output | ||
| output: | ||
|
|
||
| # https://esphome.io/components/output/ledc | ||
| - platform: ledc | ||
| id: lcd_backlight_output | ||
| pin: GPIO9 | ||
|
|
||
| # Channel 7 is on the last LEDC timer, so a buzzer note never retunes the backlight or a device's own ledc output. | ||
| # https://esphome.io/components/output/ledc | ||
| - platform: ledc | ||
| id: buzzer_output | ||
| channel: 7 | ||
| pin: | ||
| number: GPIO3 # Strapping pin, fixed board wiring, so the warning is acknowledged. | ||
| ignore_strapping_warning: true | ||
|
|
||
| # https://esphome.io/components/light/monochromatic | ||
| light: | ||
| - platform: monochromatic | ||
| name: "Backlight" | ||
| id: lcd_backlight | ||
| output: lcd_backlight_output | ||
| default_transition_length: 250ms | ||
| restore_mode: ALWAYS_OFF | ||
|
|
||
| # https://esphome.io/components/switch/gpio | ||
| switch: | ||
| - platform: gpio | ||
| id: power_hold | ||
| pin: | ||
| number: GPIO46 # Strapping pin, fixed board wiring, so the warning is acknowledged. | ||
| ignore_strapping_warning: true | ||
| restore_mode: ALWAYS_ON | ||
| internal: true | ||
|
|
||
| # https://esphome.io/components/button/template | ||
| button: | ||
| - platform: template | ||
| name: "Power Off" | ||
| id: power_off | ||
| entity_category: config | ||
| on_press: | ||
| - switch.turn_off: power_hold | ||
|
|
||
| # https://esphome.io/components/binary_sensor/gpio | ||
| binary_sensor: | ||
| - platform: gpio | ||
| name: "Button" | ||
| id: front_button | ||
| pin: | ||
| number: GPIO42 | ||
| inverted: true | ||
| mode: | ||
| input: true | ||
| pullup: true | ||
|
|
||
| - platform: gpio | ||
| name: "Boot Button" | ||
| id: boot_button | ||
| pin: | ||
| number: GPIO0 # Strapping pin, fixed board wiring, so the warning is acknowledged. | ||
| ignore_strapping_warning: true | ||
| inverted: true | ||
| mode: | ||
| input: true | ||
| pullup: true | ||
| entity_category: diagnostic | ||
|
|
||
| # https://esphome.io/components/sensor/rotary_encoder | ||
| sensor: | ||
| - platform: rotary_encoder | ||
| name: "Encoder" | ||
| id: board_encoder | ||
| pin_a: | ||
| number: GPIO40 | ||
| mode: | ||
| input: true | ||
| pullup: true | ||
| pin_b: | ||
| number: GPIO41 | ||
| mode: | ||
| input: true | ||
| pullup: true | ||
| resolution: 1 | ||
| publish_initial_value: true | ||
|
|
||
| # https://esphome.io/components/display/mipi_spi | ||
| display: | ||
| - platform: mipi_spi | ||
| id: board_display | ||
| spi_id: board_spi | ||
| model: GC9A01A | ||
| dc_pin: GPIO4 | ||
| cs_pin: GPIO7 | ||
| reset_pin: GPIO8 | ||
| invert_colors: true | ||
| data_rate: 40MHz | ||
| auto_clear_enabled: false | ||
| update_interval: never | ||
|
|
||
| # https://esphome.io/components/touchscreen/ft5x06 | ||
| touchscreen: | ||
| - platform: ft5x06 | ||
| id: board_touch | ||
| i2c_id: board_i2c | ||
| address: 0x38 | ||
| display: board_display | ||
| interrupt_pin: GPIO14 | ||
|
|
||
| # https://esphome.io/components/time | ||
| time: | ||
|
|
||
| # Home Assistant time writes through to the RTC, so the clock survives a boot with no Home Assistant. | ||
| - id: !extend homeassistant_time | ||
| on_time_sync: | ||
| - bm8563.write_time: rtc_time | ||
|
|
||
| # https://esphome.io/components/time/bm8563 | ||
| - platform: bm8563 | ||
| id: rtc_time | ||
| i2c_id: board_i2c | ||
| update_interval: never | ||
|
|
||
| # The WS1850S answers as an MFRC522. | ||
| # - Each scan fires a Home Assistant tag event, and the text sensor holds the UID until the tag leaves. | ||
| # https://esphome.io/components/binary_sensor/rc522 | ||
| rc522_i2c: | ||
| - id: board_rfid | ||
| i2c_id: board_i2c | ||
| address: 0x28 | ||
| on_tag: | ||
| - homeassistant.tag_scanned: !lambda return x; | ||
| - text_sensor.template.publish: | ||
| id: rfid_tag | ||
| state: !lambda return x; | ||
| on_tag_removed: | ||
| - text_sensor.template.publish: | ||
| id: rfid_tag | ||
| state: "" | ||
|
|
||
| # https://esphome.io/components/text_sensor/template | ||
| text_sensor: | ||
| - platform: template | ||
| name: "RFID Tag" | ||
| id: rfid_tag | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.