You need to watch your formatting otherwise it will not work.
If you want the LED to act as a status you will want something like the following:
esphome:
name: "device_name"
platform: ESP8266
board: esp8285
wifi:
ssid: wifi_ssid
password: wifi_password
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "HDO tlačítko"
on_press:
- switch.toggle: relay
- platform: status
name: "HDO status"
light:
- platform: binary
output: status_led
id: led
switch:
- platform: gpio
name: "HDO spínač"
pin: GPIO12
id: relay
restore_mode: "ALWAYS_ON"
on_turn_on:
- light.turn_on:
id: led
on_turn_off:
- light.turn_off:
id: led
output:
- platform: gpio
pin:
number: GPIO13
inverted: yes
id: status_led
You could then have an automation that tells you when the device is connected / has power.
automation:
trigger:
- platform: state
entity_id: binary_sensor.hdo_server_status
to: "on"
action:
- service: notify.notify
data:
message: Your device has power