Files
esphome/templates/tubeszb-coordinator.yaml
T
2025-05-07 17:30:46 +02:00

78 lines
1.8 KiB
YAML

# ESP32 PoE board with ZigBee module (cc2652) connected to it via serial.
# The purpose is to expose that serial port via TCP.
#
# cc2652p firmware (launchpad):
# https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin
# (latest flashed copy in zigbee-coordinator directory).
#
# Firmware flashing tool:
# https://github.com/JelmerT/cc2538-bsl
esphome:
name: "zigbee-coordinator-ch${channel}"
friendly_name: "ZigBee Coordinator CH${channel}"
project:
name: "dasfoo.zigbee-coordinator-ch${channel}"
version: "5.0"
on_boot:
priority: 600 # Default; most sensors set up, no network yet.
then:
- script.execute: cc2652_reset
packages:
device_base: !include esp32-poe.yaml
esp32:
framework:
type: esp-idf
external_components:
- source: github://oxan/esphome-stream-server
script:
- id: fw_update_mode
then:
- switch.turn_on: zBSL
- delay: 1s
- switch.turn_on: zRST_gpio
- delay: 1s
- switch.turn_off: zRST_gpio
- logger.log: "Delaying ~10 seconds for cc2652 to settle"
- delay: 11s
- switch.turn_off: zBSL
- logger.log: "Please try update with cc2538-bsl tool now"
- logger.log: "cc-bsl usage: cc2538-bsl.py -p socket://ip-of-gw:6638 -evw firmware.hex"
- id: cc2652_reset
then:
- switch.turn_on: zRST_gpio
- delay: 15ms
- switch.turn_off: zRST_gpio
button:
- platform: template
name: "ZigBee Module reset"
disabled_by_default: true
id: zRST
on_press:
- script.execute: cc2652_reset
- platform: template
name: "ZigBee Module enter programming mode"
disabled_by_default: true
on_press:
- script.execute: fw_update_mode
stream_server:
uart_id: uart_bus
id: ss
port: 6638
buffer_size: 1024
binary_sensor:
- platform: stream_server
connected:
name: "ZigBee Module serial stream connected"