M5Stack Dial - ESP32-S3 Smart Rotary Knob

Same issue for me.

I played around a bit with the implementation in esphome and then chose the path of writing a component for the ā€œdialā€. At the moment I am concentrating on implementing the main functions for all entity types. When these functions are ready, I will continue with the layout of the screens.
Maybe the component will already help someone:

7 Likes

Great work, will try to compile on my M5dial
would be nice to emulate on the M5 physical HW the native esphome ā€œclimate componentā€ and sync with HA UI

image

great! I did a few adjustments and submitted a pull request. Only thing that is not nice about this GUI is the fontā€¦ Anything better available maybe?

First and foremost, great job and thanks you for the effort!

Iā€™ve managed to install it and configure the m5dial, but I cannot get the entities listed in HA (only the firmware version appears)

What Iā€™ve tried:

  • renaming the dial
  • adding a totally unrelated entity (sensor) to esphome yaml and this worked
  • removing all the devices from shys_m5_dial: and leaving only one switch
  • renaming the entities
  • console logs show activity when using the dial (like changing the temperature or color etc.)
  • firmware version entity gets updated normally

Yaml Config:


substitutions:
  name: "esphome-web-d4a004"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password

esphome:
  name: ${name}
  name_add_mac_suffix: false
  project:
    name: smarthomeyourself.m5_dial
    version: "1.0"
    
  platformio_options:
    lib_deps:
      - WiFi
      - SPI
      - FS
      - Wire
      - EEPROM
      - ArduinoJson
      - m5stack/M5Unified
      - m5stack/M5Dial

external_components:
  - source:
      type: git
      url: https://github.com/SmartHome-yourself/m5-dial-for-esphome/
      ref: main
    components: [shys_m5_dial]
 
dashboard_import:
  package_import_url: github://SmartHome-yourself/m5-dial-for-esphome/shys-m5-dial.yaml@main
  import_full_config: false

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: "*****"

ota:
  password: "*****"

improv_serial:
captive_portal:
wifi:
  ssid: ${wifi_ssid}
  password: ${wifi_password}
  ap:
    ssid: "Esphome-Web-D4A004"
    password: "*****"

shys_m5_dial:
  name: Dial
  screen_off_time: 45000
  rotary_step_width: 2
  long_press_duration: 1200
  font: FreeSans12pt7b
  font_factor: 1

  devices:
    lights:
      - entity: light.stairs
        name: Light 1
        modes:
          dimm_mode:
            enable: true
            rotary_step_width: 2
          rgb_mode: 
            enable: true
            rotary_step_width: 5
          white_mode: 
            enable: true
            rotary_step_width: 10
            min_kelvin: 7000
    climates:
      - entity: climate.house_heating
        name: Heater
        modes:
          temp_mode:
            rotary_step_width: 2
            min_temperature: 4
            max_temperature: 30

Any hints to try and debug / fix the issue would be highly appreciated.

Thanks,

M.

Same for me
I was able to sync the M5dial with my ā€œclimateā€ component but I was not able to add the device/entity to esphome in HA
No auto discovery by HA and if I try to add manually via IP address in EspHome integation I got an error

Iā€™ve played around with mine a little more, using some of @Squall290586ā€™s code for the arcs. Changed some things around to use scripting rather than directly changes values when the encoder is rotated. A lot smoother now, but I will probably make the jumps in values a little smaller.

2 Likes

i have question, in the original soft.
The m5dial make bip on the rotation.

Have you found the pin to make a sound ?

thank in advance.

Have to define a few things. I didnā€™t use it because I didnā€™t find it quick enough, but havenā€™t gone back now things are a little more efficient

rtttl:
  output: my_speaker_output
  id: my_rtttl

output:
  - platform: ledc
    pin: GPIO3
    id: my_speaker_output

And using this example, when the RFID is scanned I play a sound

rc522_i2c:
  i2c_id:  bus_internal
  address: 0x28
  on_tag:
    then:
      - rtttl.play: "success:d=24,o=5,b=100:c,g,b"
      - homeassistant.tag_scanned: !lambda 'return x;'

Iā€™m not sure if this is the best or only method, as Iā€™ve not really looked into the speaker component. I find the physical click sound from the encoder is enough.

Is there any chance that your going to add the ability to scan RFID? When my dial was in the default firmware I tested scanning a card and it read it but after I installed your code (Thank you for) the RFID doesnā€™t do anything when I placed it on the dial.
Thank you again for your work.

For everyone following along, the display is now natively supported in esphome

I changed the display code to

- platform: ili9xxx
  model: gc9a01a
  reset_pin: GPIO8
  id: my_lcd
  cs_pin: GPIO7
  dc_pin: GPIO4
  dimensions: 
    height: 240
    width: 240

You still need the custom component for the ft3267 touchscreen.

2 Likes

Shouldnā€™t model be M5STACK then ?

Didnā€™t even see it in the list, but thatā€™s the square version, not the dial. When I use m5stack I get this

The native component seems a lot more performant as well, which is great.

Do you mind sharing your yaml file?

I posted it further up, but here it is esphome_files/m4_dial_v2.yaml at f7d57a31d51e24e87bda72b74bbb98e290113182 Ā· dgaust/esphome_files Ā· GitHub

Iā€™ve changed it up so you only need to put the light, climate and cover entity_ids once in the substitutions section

substitutions:
  # Add the ids of the devices you want to control here
  light_control: light.great_room_dimmer_4
  climate_control: climate.doris
  cover_control: cover.sunshade

Thank you so much

Also found a handy 3d printable enclosure for it. You can fit a battery and usb-c charge controller in it if you wanted.

4 Likes

Hello. I try to install your yaml code on my m5 dial and stock in file validation. Itā€™s shows me that:


Please help me to understand what itā€™s mean , and how to fix that. Thank you.
Also,if you donā€™t mind to share some of the images for switches and other devices for this unit. I got a background and QR code , but not the rest of the images yet. Thank you again

Have you added the substitutions section in? Thatā€™s where the delay is defined.

substitutions:
  # Add the ids of the devices you want to control here
  light_control: light.great_room_dimmer_4
  media_player_control: media_player.living_room
  climate_control: climate.doris
  cover_control: cover.sunshade
  script_delay: 1s

All the other images are MDI files, so you shouldnā€™t need to download them. Since Iā€™m running a few dials now, I moved them to a separate file and use the include function to bring those into the device settings

<<: !include common/colors.yaml
<<: !include common/images.yaml
1 Like

My mistake, I took a delay out some hoe when copy and paste your code. Thank you.
I create a colors.yaml and images.yaml files in esphome /common directory
Working now. Playing with settings and devices. Thank you very much for you hard work.

1 Like