M5StickC PLUS
介绍
-
前两年京东薅羊毛买的,一直落灰,当时准备玩语音助手买的,但是之前 HASS 语音这块就没搞,只能自己找其他开源项目玩,还要写代码就没精力折腾,落灰很久了
-
这个月正好 HASS 的语音终于上线了,于是想着接入玩玩 ,不过目前 HASS 还有个配置的 BUG 没搞定,等官方或高手解决了
-
不定期更新玩法
ESPHome
-
适配情况
传感器 GPIO 支持情况 红外发射管 IR 1 支持 无源蜂鸣器 2 支持 红色 LED 10 支持 电源管理芯片 (AXP192) 21、22 支持 按键 BUTTON A 37 支持 按键 BUTTON B 39 支持 六轴 IMU (MPU6886) 21、22 支持 彩色 TFT 屏幕 5、13、15、18、23 支持 麦克风 MIC (SPM1423) 0、34 待测试 -
配置
substitutions: device_name: m5stickc_plus esphome: name: ${device_name} esp32: board: m5stick-c framework: type: arduino external_components: - source: github://airy10/esphome-m5stickC logger: api: encryption: key: !secret api_encryption_key services: - service: send_raw_command variables: command: int[] then: - delay: 1s - remote_transmitter.transmit_raw: code: !lambda "return command;" carrier_frequency: 38kHz ota: password: !secret ota_password wifi: ssid: !secret wifi_ssid password: !secret wifi_password fast_connect: on web_server: port: 80 button: - platform: restart name: ${device_name}_reboot - platform: shutdown name: ${device_name}_shutdown - platform: template name: ${device_name}_echo id: my_button on_press: - voice_assistant.start: - delay: 5s - voice_assistant.stop: remote_transmitter: pin: 9 carrier_duty_percent: 50% text_sensor: - platform: wifi_info ip_address: id: ${device_name}_ip name: ${device_name}_ip mac_address: name: ${device_name}_mac i2c: - id: ${device_name}_i2c sda: 21 scl: 22 scan: true sensor: - platform: uptime name: ${device_name}_uptime - platform: wifi_signal name: ${device_name}_signal - platform: internal_temperature id: ${device_name}_cpu_temprature name: ${device_name}_cpu_temprature - platform: mpu6886 address: 0x68 accel_x: id: ${device_name}_imu_accel_x name: ${device_name}_imu_accel_x on_value_range: - below: -5.0 then: - light.turn_on: ${device_name}_led - above: -5.0 then: - light.turn_off: ${device_name}_led accel_y: id: ${device_name}_imu_accel_y name: ${device_name}_imu_accel_y on_value_range: - below: -5.0 then: - light.turn_on: id: ${device_name}_buzzer brightness: 50% - above: -5.0 then: - light.turn_off: ${device_name}_buzzer accel_z: id: ${device_name}_imu_accel_z name: ${device_name}_imu_accel_z gyro_x: id: ${device_name}_imu_gyro_x name: ${device_name}_imu_gyro_x gyro_y: id: ${device_name}_imu_gyro_y name: ${device_name}_imu_gyro_y gyro_z: id: ${device_name}_imu_gyro_z name: ${device_name}_imu_gyro_z temperature: name: ${device_name}_imu_temperature update_interval: 2000ms - platform: axp192 address: 0x34 i2c_id: ${device_name}_i2c update_interval: 5s battery_level: name: ${device_name}_battery_level id: ${device_name}_battery_level output: - platform: ledc frequency: 1000Hz pin: number: 10 inverted: yes id: ${device_name}_ledc_led - platform: ledc frequency: 1000Hz pin: number: 2 inverted: yes id: ${device_name}_ledc_buzzer light: - platform: monochromatic output: ${device_name}_ledc_led id: ${device_name}_led name: ${device_name}_led - platform: monochromatic output: ${device_name}_ledc_buzzer id: ${device_name}_buzzer name: ${device_name}_buzzer spi: clk_pin: 13 mosi_pin: 15 display: - platform: st7789v id: ${device_name}_lcd model: TTGO TDisplay 135x240 cs_pin: 5 dc_pin: 23 reset_pin: 18 lambda: |- it.printf(0, 0, id(${device_name}_font), "%s", id(${device_name}_ip).state.c_str()); it.printf(0, 20, id(${device_name}_font), "%.1f%", id(${device_name}_battery_level).state); font: - file: "gfonts://Roboto" id: ${device_name}_font size: 20 i2s_audio: i2s_lrclk_pin: 0 i2s_bclk_pin: 1 microphone: - platform: i2s_audio i2s_din_pin: 34 id: ${device_name}_microphone voice_assistant: microphone: ${device_name}_microphone binary_sensor: - platform: gpio pin: number: 37 inverted: true name: ${device_name}_button_a id: ${device_name}_button_a on_press: - voice_assistant.start: on_release: - voice_assistant.stop: - platform: gpio pin: number: 39 inverted: true name: ${device_name}_button_b id: ${device_name}_button_b