mirror of
https://github.com/esphome/esphome.git
synced 2025-11-03 08:31:47 +00:00
55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
<<: !include http_request.yaml
|
|
|
|
wifi:
|
|
ssid: MySSID
|
|
password: password1
|
|
|
|
ota:
|
|
- platform: http_request
|
|
id: http_request_ota
|
|
on_begin:
|
|
then:
|
|
- logger.log: "OTA start"
|
|
on_progress:
|
|
then:
|
|
- logger.log:
|
|
format: "OTA progress %0.1f%%"
|
|
args: ["x"]
|
|
on_end:
|
|
then:
|
|
- logger.log: "OTA end"
|
|
on_error:
|
|
then:
|
|
- logger.log:
|
|
format: "OTA update error %d"
|
|
args: ["x"]
|
|
on_state_change:
|
|
then:
|
|
lambda: 'ESP_LOGD("ota", "State %d", state);'
|
|
|
|
button:
|
|
- platform: template
|
|
name: Firmware update
|
|
on_press:
|
|
then:
|
|
- ota.http_request.flash:
|
|
id: http_request_ota
|
|
md5_url: http://my.ha.net:8123/local/esphome/firmware.md5
|
|
url: http://my.ha.net:8123/local/esphome/firmware.bin
|
|
|
|
- ota.http_request.flash:
|
|
id: http_request_ota
|
|
md5: 0123456789abcdef0123456789abcdef
|
|
url: http://my.ha.net:8123/local/esphome/firmware.bin
|
|
|
|
- logger.log: "This message should be not displayed (reboot)"
|
|
|
|
update:
|
|
- platform: http_request
|
|
name: OTA Update
|
|
id: ota_update
|
|
ota_id: http_request_ota
|
|
source: http://my.ha.net:8123/local/esphome/manifest.json
|
|
on_update_available:
|
|
- logger.log: "A new update is available"
|