redpis
(Redpis)
June 20, 2024, 6:17pm
1
Just updated esphome and now I cant access the devices, error message:
INFO ESPHome 2024.6.1
INFO Reading configuration /config/esphome/cylinder-temp.yaml…
Failed config
ota.unknown: [source /config/esphome/cylinder-temp.yaml:27]
‘ota’ requires a ‘platform’ key but it was not specified.
Any idea how to add the required platform key to resolve my issue please
1 Like
Edwin_D
(Edwin D.)
June 20, 2024, 6:23pm
2
It’s in the docs (the requirement has changed):
Because of this breaking change mentioned in the release notes:
esphome:dev
← kbx81:separate-ota-backend
opened 12:55AM - 02 Apr 24 UTC
# What does this implement/fix?
Splits the OTABackend out from the OTA compon… ent so that it can be more easily used by other (future) OTA platforms.
#6475 should be merged _before_ this PR or validation won't enforce the presence of a platform under `ota:`, potentially rendering devices un-OTA-able!
#6623 should also be merged before this PR as it permits more user-friendly error messages should the required `esphome` platform not be present when components which depend on it (`safe_mode` `button` or `switch`) are present.
## Breaking Change Notes
This change only impacts the OTA configuration as it exists in YAML; it does not affect ESPHome's original OTA functionality. Existing configuration variables placed under `ota:` must be moved into the `esphome` OTA platform. For example, if your original configuration looked like this:
```yaml
ota:
password: "xxxxxxxxxxxxxxxx"
num_attempts: 3
safe_mode: no
```
...you now need to arrange it like this:
```yaml
ota:
- platform: esphome
password: "xxxxxxxxxxxxxxxx"
num_attempts: 3
safe_mode: no
```
No other changes are required to continue using OTA and you will be able to update your devices in the same manner as before.
## Types of changes
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] Other
**Related issue or feature (if applicable):** fixes <link to issue>
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable): esphome/esphome-docs#3782**
## Test Environment
- [x] ESP32
- [x] ESP32 IDF 4 + 5
- [x] ESP8266
- [ ] RP2040
- [ ] BK72xx
- [ ] RTL87xx
## Example entry for `config.yaml`:
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR. Furthermore, for new integrations, it gives an impression of how
the configuration would look like.
Note: Remove this section if this PR does not have an example entry.
-->
```yaml
# Example config.yaml
```
## Checklist:
- [x] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs). **N/A**
Though the release notes do not make very clear what is needed. But the error does.
1 Like
redpis
(Redpis)
June 20, 2024, 6:34pm
3
Many thanks for the swift replies, to experienced users the instructions are ‘noddy proof’, but after reading, for me the simplest is to flatten the ESP device and restart.
Here, read this in case it helps. Someone has already gone through the trouble of creating simple instructions and pinned the post so others would find it.
In esphome 2024.6 the ota configuration has changed, and it you have ota: in your yaml file it won’t compile without fixing.
The old invocation was
ota:
password: secretstuff
You now need to add platform, so it will look like this:
ota:
- password: secretstuff
platform: esphome
this will get you there. There is now also a platform: http_request as well, hence the need for a change.
This is dealt with in the changelog ESPHome 2024.6.0 - 19th June 2024 — ESPHome , but I just wanted …
Thanks for your contribution @nickrout
5 Likes
redpis
(Redpis)
June 20, 2024, 7:54pm
5
Thanks for the info to the guide, it worked which is great, I was adding the platform detail before the password as per the ESP OTA config, but it didn’t like it, anyhoo it works now.
Thanks for you help, much appreciated.
nickrout
(Nick Rout)
June 20, 2024, 8:18pm
6
The order shouldn’t matter.
Vityulka
(Victor)
October 19, 2024, 9:10pm
7
redpis:
platform
I had the same problem. Essentially, the “platform” key is missing. The easiest way is just to create a new device and compare the config YAML.
kkilchrist
(Kameron Kilchrist)
October 19, 2024, 11:11pm
8
To make this super clear
change
ota:
password: !secret ota_password
to
ota:
platform: esphome
password: !secret ota_password
11 Likes
safari2
(Safari2)
December 10, 2024, 4:27am
9
Hi.
I have tha same problem.
I have ‘ota’ requires a ‘platform’ key but it was not specified.
Whan I added platform key esphome, Validated is ok, but new problem is:
INFO ESPHome 2024.11.3
INFO Reading configuration /config/esphome/livingroom.yaml…
INFO Generating C++ source…
INFO Compiling app…
Processing livingroom (board: d1_mini; framework: arduino; platform: platformio/[email protected] )
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Library Manager: Installing ESP8266WiFi
Warning! Could not find the package with ‘ESP8266WiFi’ requirements for your system ‘linux_aarch64’
Library Manager: Installing ESP8266mDNS
Warning! Could not find the package with ‘ESP8266mDNS’ requirements for your system ‘linux_aarch64’
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 1.1.0
|-- noise-c @ 0.1.6
Compiling .pioenvs/livingroom/src/esphome/components/api/api_connection.cpp.o
In file included from src/esphome/components/network/ip_address.h:16,
from src/esphome/components/network/util.h:5,
from src/esphome/components/api/api_connection.cpp:6:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:43:10: fatal error: core_esp8266_version.h: No such file or directory
Looking for core_esp8266_version.h dependency? Check our library registry!
CLI > platformio lib search “header:core_esp8266_version.h”
Web > PlatformIO Registry
43 | #include “core_esp8266_version.h”
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/livingroom/src/esphome/components/api/api_connection.cpp.o] Error 1
========================= [FAILED] Took 13.80 seconds =========================
nickrout
(Nick Rout)
December 10, 2024, 4:28am
10
No yaml, what the heck do you want anyone to do?
safari2
(Safari2)
December 10, 2024, 4:38am
11
I have just pressed ‘edit’ in esphome compiler, added key and pressed ‘save’.
What I do wrong?
Link ‘install’ was gone. I tried to press install in the … right menu.
safari2
(Safari2)
January 2, 2025, 9:58pm
13
esphome:
name: livingroom
friendly_name: LivingRoom
on_boot:
priority: 600
# ...
then:
- switch.turn_off: D0Buzzer
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "KbJRFiTE1OzisDeB+p6qGyPV7HdA8S4IbOFxlzp1CEo="
ota:
platform: esphome
password: "qqqqqqqqqqqqqqqqqqq"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.99.22
gateway: 192.168.99.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Livingroom Fallback Hotspot"
password: "qqqqqqqqqqqqqq"
mdns:
disabled: false
captive_portal:
binary_sensor:
- platform: gpio
name: "LivingRoom D5 switch sensor"
id: D5button
pin:
number: D5
inverted: false
mode:
input: true
pullup: true
filters:
- delayed_on: 10ms
- delayed_off: 10ms
on_press:
then:
- switch.toggle: D2output
- switch.turn_on: D0Buzzer
- delay: 100 ms
- switch.turn_off: D0Buzzer
- platform: status
name: "LivingRoom D5 switch Status"
- platform: gpio
name: "LivingRoom D6 switch sensor"
id: D6button
pin:
number: D6
inverted: false
mode:
input: true
pullup: true
filters:
- delayed_on: 10ms
- delayed_off: 10ms
on_press:
then:
- switch.toggle: D1output
- switch.turn_on: D0Buzzer
- delay: 100 ms
- switch.turn_off: D0Buzzer
- platform: status
name: "LivingRoom D6 switch Status"
# Blink the Blue LED
switch:
- platform: output
name: "LivingRoom D0 Buzzer Output"
inverted: false
id: D0Buzzer
output: D0Buzzer_output
- platform: output
name: "LivingRoom D1 Output"
inverted: false
id: D1output
output: light_output1
- platform: output
name: "LivingRoom D2 Output"
inverted: false
id: D2output
output: light_output2
output:
- id: light_output1
platform: gpio
pin: D1
- id: light_output2
platform: gpio
pin: D2
- id: D0Buzzer_output
platform: gpio
pin: D0
nickrout
(Nick Rout)
January 3, 2025, 4:26am
14
Try changing to
ota:
- platform: esphome
password: "qqqqqqqqqqqqqqqqqqq"
If that doesn’t work, do a clean then an install. If that doesn’t work. post the log (not a picture) of the install.