Resend commands to battery powered ESP32

Hi everyone!

I have a slight problem:
I’m using a battery powered ESP32 as a status indicator for a project.
If Home Assistant sends out the status information (= LED 1 on) while the ESP32 isn’t running, that command is “lost” and if I turn on the ESP32 now it’s not doing anything until the status changes.

Is there a way to send out commands regularly even if the status hasn’t changed?

I was thinking:
[if conditions are met]
{repeat}
- “Light turn on”
- “wait 60 seconds”

maybe there’s a smarter way?

Thanks!

maybe doing it the other way around, set it up the way that esphome requests the state.

You can watch a HA entity with something like this and execute whatever you want based on conditions

...
binary_sensor:
  - platform: homeassistant
    name: "my cool name"
    id: my_cool_id
    internal: true
    entity_id: switch.my_id #Change the entity from your Home Assistant
    on_state:
      then:
        - if: 
            condition:
              - binary_sensor.is_on: my_cool_id
            then:
              #do something
            else:
              #do something
...
1 Like

They also may need to use this setting.

publish_initial_state:

It’s probably a good idea to share your config at this point.