How to override and *disable* web_server

My plug has the following configuration:

substitutions:
  device_name: "dehumidifier-plug"
  friendly_name: "Dehumidifier Plug"
packages:
  athom.smart-plug-v2: github://athom-tech/athom-configs/athom-smart-plug-v2.yaml
esphome:
  name: ${device_name}
  name_add_mac_suffix: false


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

The imported configuration enables web_server. However, I have been experiencing stability issues with these plugs and I would like to try disabling it. I am looking for some incantation which I can add to my configuration which will disable web_server in the expanded output I see when selecting 'Validate`.

I have already whispered the following into the void without result:

web_server: {}

and

web_server:
  port: null

The latter I tried because the imported configuration only defines port, but the expanded configuration contains more. I wondered if I could explicitly unset port and avoid the setting of anything else, but it had no effect at all.

I can obviously just fork the imported configuration, but I was hoping to avoid that. Any ideas?

Maybe something with remove?

Just copy whole yaml from that “imported” file to your yaml, remove “web server” and you’re done. And, of course, remove “packages…:” lines. I always do that way - i hate “imported” stuff, because i don’t know what’s going on and what i have configured… it becomes kinda “black mystery box” with unknown stuff inside…

2 Likes

They did mention they didn’t want to do that…

True, but if you can’t do that then this is simple and quick solution, correct?

Not all can be done …like i have a “common” file for all my esp’s with definitions that all esp’s must have, then i just include common file in my yaml. But, if i put “api” definitions there it won’t compile (reports an error). So i just simply put api in each of my api and voila.

1 Like

This looked promising, but afaict you can only !remove if you used !include, which I didn’t because it’s a remote repo.

The docs do say:

Since packages are incorporated using the !include system…

and they don’t exclude remote packages from that. I suspect this is either possible with some unintuitive or undocumented syntax, or nearly possible with some code tweaks.

1 Like

I’ve opened a feature request: Support for removing elements imported by a remote package · Issue #2530 · esphome/feature-requests · GitHub

1 Like
web_server: !remove

works fine in latest ESPHome. You can close the ticket or transform it into a request for better docs.

1 Like