Native ESPHome gree climate component over the API, no MQTT/Broadlink/Tuya. HA on piha runs as a plain Docker container (not HAOS), so ESPHome is a manual docker compose run --rm invocation, not a managed service — device is deliberately not registered in hosts/piha/services.yaml.
29 lines
833 B
Bash
Executable file
29 lines
833 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
# Manual deploy only — this device is not managed via hosts/piha/services.yaml.
|
|
# Run by hand on piha after wiring the board.
|
|
cd "$(dirname "$0")"
|
|
|
|
if [ ! -f secrets.yaml ]; then
|
|
echo "ERROR: secrets.yaml missing. Copy secrets.yaml.example to secrets.yaml and fill in wifi_ssid/wifi_password/fallback_password." >&2
|
|
exit 1
|
|
fi
|
|
|
|
USB=false
|
|
if [ "$1" = "--usb" ]; then
|
|
USB=true
|
|
fi
|
|
|
|
if [ "$USB" = true ]; then
|
|
if [ ! -e /dev/ttyUSB0 ]; then
|
|
echo "ERROR: /dev/ttyUSB0 not found. Plug in the board via USB for the first flash." >&2
|
|
exit 1
|
|
fi
|
|
echo ">>> First flash over USB (/dev/ttyUSB0)..."
|
|
docker compose run --rm --device /dev/ttyUSB0 esphome run gree-ir-blaster.yaml --device /dev/ttyUSB0
|
|
else
|
|
echo ">>> OTA flash over WiFi..."
|
|
docker compose run --rm esphome run gree-ir-blaster.yaml
|
|
fi
|