ESPHome: time: dynamically enable/disable on_time settings

Just program a rollershutter. My old one has timers, but I can also switch to a full manual mode. I want to have this modes with my new fancy ESPhome switch too.

I know how to program timers in ESPHome - as for instance:

    on_time:    
    # Every morning on weekdays
      - days_of_week: MON-FRI
        hours: 06
        minutes: 30
        seconds: 0
        then:
          - switch.toggle: switch_up 

But now the 100$ question: How can I disable that without reflash the programm? My idea would be to do a long press on stop button to switch between timer and manual (no timer) mode.

IMHO see no way to disable on_time:, but You can program whatever logic You want in then:.
Create binary_sensor or switch for manual/auto and then just do nothing if manual mode switched on.

1 Like

Thank you. Will see how this is possible. Seem to be some work to do. Wondering that this is no one else requesting - maybe all are trust in their networks. But I have to care about the waf (womens acceptance factor) and this needs that feature to turn off the (offline-)timer.

then:
      if:
        condition:
          your-condition-here
        then:
         - switch.toggle: switch_up
1 Like