ESPhome without HASS

Hi, today I had a crash on my HASS server, and wished to use a Sonoff switch urgently, and of course I could not.

So as a backup I wish to be able to control the switch also without HASS for those cases. I tried but did not succed.

My switch art of the Sonoff POW R1 flashed is this below (it works perfectly in HASS)

  - platform: template
    name: "guest_room_tv_power_plug"
    optimistic: true
    id: guest_room_tv_fakebutton
    - switch.turn_on: relay
    - light.turn_on: led
    - switch.turn_off: relay
    - light.turn_off: led
  - platform: gpio
    id: relay
    pin: GPIO12

and I gave this POST command, but the switch did not turn on. Where is my mistake?
1 Like

Perhaps some help here? Not sure though.

To use the rest API you need to configure the http component.

1 Like

I have mine setup so that the button on the sonoff triggers the relay. This only works if your sonoff is in an accessible place of course…

add the web_server: component to your device, and then simply browse to the device’s ip address.
All switches and sensors will be in the web frontend.

I had that.

After a restart its working, don’t know what happened.

@OttoWinter Love this ESPHome, absolutely love it. Very cool. I am not buying any WiFi device if cannot be flashed with ESPHome.

BTW any chance that Yeelight lightbulbs can be flashed with ESPhome, maybe in the future, or is technically impossible?

1 Like