├── IMG_3052.jpeg ├── IMG_3053.jpeg ├── IMG_3054.jpeg ├── M5Stack_poesp32.yaml ├── M5Stack_poesp32_pool_temp.yaml └── README.md /IMG_3052.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DrJohnM61/poesp32-esphome/HEAD/IMG_3052.jpeg -------------------------------------------------------------------------------- /IMG_3053.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DrJohnM61/poesp32-esphome/HEAD/IMG_3053.jpeg -------------------------------------------------------------------------------- /IMG_3054.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DrJohnM61/poesp32-esphome/HEAD/IMG_3054.jpeg -------------------------------------------------------------------------------- /M5Stack_poesp32.yaml: -------------------------------------------------------------------------------- 1 | 2 | esphome: 3 | name: m5stack 4 | friendly_name: Gate Control 5 | 6 | esp32: 7 | board: m5stack-core-esp32 8 | 9 | # Enable logging 10 | logger: 11 | 12 | ethernet: 13 | type: IP101 14 | mdc_pin: GPIO23 15 | mdio_pin: GPIO18 16 | clk_mode: GPIO0_IN 17 | power_pin: GPIO5 18 | phy_addr: 1 19 | 20 | # Enable Home Assistant API 21 | api: 22 | encryption: 23 | key: "MpjOHfRgTREDTh3wsqfMvOQmOmy7SN/nALAOXFNLMcQ=" 24 | switch: 25 | - platform: gpio 26 | id: gate_relay16 27 | pin: GPIO16 28 | name: "Gate Switch 16" 29 | 30 | - platform: gpio 31 | id: gate_relay17 32 | pin: GPIO17 33 | name: "Gate Switch 17" 34 | -------------------------------------------------------------------------------- /M5Stack_poesp32_pool_temp.yaml: -------------------------------------------------------------------------------- 1 | 2 | esphome: 3 | name: poesp32_pool_temp_1 4 | friendly_name: PoESP32 Pool Sensor #1 5 | 6 | esp32: 7 | board: m5stack-core-esp32 8 | 9 | # Enable logging 10 | logger: 11 | 12 | ethernet: 13 | type: IP101 14 | mdc_pin: GPIO23 15 | mdio_pin: GPIO18 16 | clk_mode: GPIO0_IN 17 | power_pin: GPIO5 18 | phy_addr: 1 19 | 20 | # Enable Home Assistant API 21 | api: 22 | encryption: 23 | key: "MpjOHfRgTREDPh3wsqfMvOQmOmy7SN/nALAOXFNLMcQ=" 24 | 25 | switch: 26 | - platform: gpio 27 | id: gate_relay16 28 | pin: GPIO16 29 | name: "Relay Switch 16" 30 | - platform: safe_mode 31 | name: "Pool Temp 1 Restart (Safe Mode)" 32 | 33 | button: 34 | - platform: restart 35 | name: "Pool Temp 1 Restart" 36 | 37 | dallas: 38 | - pin: GPIO17 39 | 40 | sensor: 41 | - platform: dallas 42 | index: 0 43 | name: "Pool Temperature #1" 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | These are the instructions to get an M5Stack poesp32 running on ESPHOME and setting the UART2 pins TX and RX to switch a relay. 2 | 3 | Device: 4 | 5 | Edit the `M5Stack_poesp32.yaml` file and rename the switches to whatever you want to call them. 6 | Change the API to one that you generate (you can use and set the length to 32). 7 | 8 | Ensure that we have the latest version of ESPHome, Python, and other packages[^1]: 9 | 10 | ```shell-session 11 | brew update 12 | brew upgrade 13 | ``` 14 | 15 | Update `pip`: 16 | 17 | ```shell-session 18 | python3 -m pip install --upgrade pip 19 | ``` 20 | 21 | Update ESPHome: 22 | 23 | ```shell-session 24 | pip3 install -U esphome 25 | ``` 26 | 27 | Disassemble the POESP32 and connect the pins on the board to the USB serial adaptor (with the USB disconnected). 28 | 29 | Ensure that RX -> TX and TX - RX. 30 | 31 | Plug in the USB while holding/strapping the G0 pin to the top of the ESP32 chip. This will put it into bootloader mode. 32 | 33 | Note the usb device that the M5Stack POESP32 is plugged into. If you see more than one device, unplug and re-run the command to see what the new device name is. 34 | 35 | ```shell-session 36 | ls /dev/ | grep cu.usbserial 37 | ``` 38 | 39 | To build the ESP device with the coded YAML template, run the following command: 40 | 41 | ```shell-session 42 | esphome run M5Stack_poesp32.yaml 43 | ``` 44 | 45 | Select the correct USB interface found in the first step. 46 | 47 | > [!CAUTION] 48 | > Don't wipe a wrong device plugged into the computer. 49 | 50 | You should see progress: compile followed by writing the data to the device. If the device is not connected properly, then the load will fail. Check the connection and try again. 51 | 52 | Make note of the encryption password for adding the device to home assistant. 53 | 54 | Unplug the USB and plug in the POE ethernet cable. You should see the lights blinking. Go to Home Assistant and the device should be shown as a new device under the left-hand "settings" menu. 55 | 56 | [^1]: These instructions are for macOS and require [Homebrew](https://brew.sh/). 57 | --------------------------------------------------------------------------------