Timed Switch

Looking for advice on how to set up a time based switch.

I have a coffee machine that takes around 30 mins to warm up, it is currently on a smart plug that we just switch on via HA when we wake up. Is there any way to do this so it is set to come on a set time, but the time can be changed each day? For example when I go to bed each day and set my alarm, I’d like to be able to set the coffee machine to come on at x time as my alarm is usually different each day.

Create an input datetime helper with time only.

Use that in a time triggered automation to turn on your smart switch.

automation:
  - trigger:
      - platform: time
        at: input_datetime.coffee_on_time
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.coffee_machine

Put the input datetime on your dashboard.

This trigger 10 mins before my alarm on my phone

{{now().strftime("%a %h %d %H:%M %Z %Y") == (((state_attr('sensor.mobil_naeste_alarm', 'Time in Milliseconds') | int / 1000) - 10*60 ) | timestamp_custom('%a %h %d %H:%M %Z %Y'))}} 

Excellent thanks.

1 Like