Backup for when HA connection is lost

Is there a way to program the ESP’s in ESPHome to execute commands (read button presses to turn on/off lights) by itself, for when the (Lan or Wifi) connection to HA would be down or when HA has crashed ?

This would be cool to have it backed up like this, especially for the WAF (Wife Accentancy Factor) … not being 100% dependent on HA anymore for operating basic things (e.g. switch lights on/off).

pressing a button for switching on a light, but when HA doesn’t respond by turning on the light, ESP does it by itself …

… something like that ?

makes sense ?

… I wonder …

You can set up a light in esphome which will show up in HA as alight with the normal light controls.

You can also set up a button in esphome which will turn the light on and off with a esphome automation.

That will continue to work when HA is not there.

Think you may find your answer at the very beginning of this Web page:

1 Like

yes, this is a way to have ESPHome ALWAYS control the light … which takes away all the advantages of using HA automations to control the lights (sometimes adding extra commands when pressing a light switch) …

so, isn’t there a way to insert something like “… but if HA doesn’t respond, do it yourself”

so it only kicks in when HA is down …

Why does it take away the HA advantages?
It only takes away the turn_on service call and you can still react to the light being turned on.

1 Like

what they mean is that actually what you ask is already in ESPHome,

90% of my lights have esphome switches (as well as dimmers), and they continue working also when HA is offline.
And it doesn’t matter what triggered the light; HA will show the status accordingly…

can the ESP be programmed to do dimming as well ?
short push on/off (on to the last set dim value off to zero) ?
long push dim step 5% or 10% up/down ?
double push is on to 100%
really ?!

I had Zwave dimmers before and they worked like above … would be awesome to bring this back to my ESP dimmers as well …

how ?

Maybe have a look here as apparently that code works:

One of many Google results on your question.

No it doesn’t.

yes

really! :grin:

you can do something like this just need to add more the timing:

  - platform: gpio
    name: "GA_Em_B_Szoba_Kapcsolo_5"
    id:   "GA_Em_B_Szoba_Kapcsolo_5"
    pin:
      number: GPIO32
      inverted: true
      mode:
        input: true
        pullup: true
    filters:
      - delayed_on: 30ms
      - delayed_off: 30ms 
    on_multi_click:
      - timing:
          - ON for 40ms to 400ms
          - OFF for 40ms to 300ms
          - ON for 40ms to 400ms
          - OFF for at least 330ms
        then:
          - text_sensor.template.publish:
              id: GA_Em_B_Szoba_Kapcsolo_KEYS
              state: !lambda 'return "double_5";'
      - timing:
          - ON for 40ms to 400ms
          - OFF for 40ms to 300ms
          - ON for 40ms to 400ms
          - OFF for 40ms to 300ms
          - ON for 40ms to 400ms
          - OFF for at least 50ms
        then:
          - text_sensor.template.publish:
              id: GA_Em_B_Szoba_Kapcsolo_KEYS
              state: !lambda 'return "triple_5";'

you can check here:

i guess this is exaqcly what you want:

on_multi_click:
- timing:
    - ON for at most 1s
    - OFF for at most 1s
    - ON for at most 1s
    - OFF for at least 0.2s
  then:
    - logger.log: "Double Clicked"
- timing:
    - ON for 1s to 2s
    - OFF for at least 0.5s
  then:
    - logger.log: "Single Long Clicked"
- timing:
    - ON for at most 1s
    - OFF for at least 0.5s
  then:
    - logger.log: "Single Short Clicked"