Dynamically disable or enable component

Hello, I am trying to make a primitive security system using ESP32-CAM. I have an input bool in my HA instance dictating whenever “alarm mode” is enabled - I’d like my ESP devices to only output the camera feed whenever that value is true.

I have this configuration so far, where it can listen to the HA entity state and turn on or off the front LED light, but I haven’t been able to figure out how to disable or enable the esp32_camera component - if that even is possible?

  - platform: homeassistant
    name: "Alarm mode enabled"
    entity_id: input_boolean.alarm_mode
      switch.turn_on: led_indicator
      # turn on camera component
      switch.turn_off: led_indicator
      # turn off camera component

# front light
  - platform: gpio
    id: led_indicator
    internal: true
      number: GPIO4
      mode: OUTPUT
    restore_mode: ALWAYS_OFF

    pin: GPIO0
    frequency: 20MHz
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  name: "Generic Camera 001"

Thank you.

1 Like

Hi, I’d like to do just the same: have you found a way?


Same here.

Same here…

Same here…same here…same here… everybody wants the same thing but is unwilling to make an effort to do it. Did you look at the documentation? See the configuration to power_down the camera??
Hhhmm that sounds like what you all sre looking for, ya?
So if have a pin to power it down and we want to toggle it on or off, then we need a switch/button, ya?
So we create that switch/button to toggle the gpio we set as the power_down gpio, ya? Make sense?
Dont just wait around for someone else to do it for you. Step up and make an effort and try.

Theres also a search box here in the forum. You know you can type things in and search for them, right? You dont have to just sit here and wait for a handout, right? Thats what bums do on the street corner.

jesus bro i found this almost immediately, but that’s not what we asked. My dev board has the OV2640 power down pin connected to ground. I’m interested in disabling the camera component during runtime, and apparently that’s not possible, i even dove deep into the esphome code here , and couldnt find a way which reliably works.
But thanks a lot for the suggestion smartass

Ya, thats not what anyone asked. The question was how to disable/enable from the HA front-end.