ESPHome Disable WiFi in order to save power

I would like a way to conditionally disable/enable wifi in order to save power in battery operation.
Example: Wake up, disable wifi, wait some time, read sensors, etc. Condition: go back to sleep or connect to wifi and send/receive data.

Hi richardax,

Disable it in what?
Your Home Assistant Server?
Your Router?
IOT Devices?
Your Phone?
Your Watch?

Please provide a lot more information, what you want to do, why is it a good thing to do, what you have tried so far to accomplish it.
You are trying to recruit someones help here within the Open Source project, and we can’t tell what you really want, much less want to invest any time into your project.

Sounds like esphome? If its a specific problem it might be easier to solve that.

Sorry, updated title and tagged it with ESPhome.
Thought I did that when posted but obviously I did not.

Does deep sleep mode not save power sufficiently?

But that already exists in esphome:

on_...:
  then:
    - wifi.disable:
1 Like

From what I have read it does not work as expected. And there is no wifi.enable

Where did you hear that? Did you try it by yourself if it’s true? Why not? What does it mean “as expected”? What do you expect this command to do? Turn off wifi? Well, it does that.

really? What’s this then (taken from esphome’s documentation):

You didn’t even bother to explore what i suggested, didn’t you? PLEASE double-check before writing nonsense…

This code works perfectly for me:

button:
  # --------------------------------------------------------------- WiFi rescan
  - platform: template
    name: "WiFi rescan"
    on_press:
      - logger.log: "Re-scanning WiFi networks:"
      - logger.log: "Turning off Wifi..."
      - wifi.disable:
      - delay: 5s
      - logger.log: "Turning Wifi back on..."
      - wifi.enable:

And, a piece of advice: it’s always a very good idea to do an extensive search for a certain topic before you make a feature request. Requesting something that it’s already been done (ages ago) just unnecesarry increases load on developers, who already do this in their free time for no money( at least many of them) .

For this particular case opening google search, entering words “esphome disable wifi” returns you wanted function in first hit:

1 Like

Well ESPHome Feature requests don’t go here, unfortunately…

Please move it here: ESPHome Feature Requests