I wanted to power on my espresso machine using a one-shot timer from the dashboard. That way I can turn the machine on half an hour before my guests arrive. I was able to achieve this in a very convoluted way, but it works.
- Create a datetime input helper to hold the start time.
- Create a script that sets the datetime helper to the current time. I use this to make it easier to enter a time later today without knowing the current date. Once it’s reset I only have to set the time. Because I’ve included the date it will only run once.
- Create an entities card with a single entity pointing to the datetime helper. I’m using an entities card because it supports
tap_action
which is calling the script mentioned above.
I think you can get around using a date by setting a boolean flag when a trigger happened and resetting it once a new time has been entered. However, this required some bookkeeping which seemed too much of a hassle to me.
I really hope one-shot timers will be introduced to make this process a whole lot easier!
Entities card
- type: entities
entities:
- entity: input_datetime.espressomachine_starttijd
name: Starttijd
icon: mdi:refresh
tap_action:
action: call-service
service: script.espressomachine_timer_resetten
Service call
service: input_datetime.set_datetime
data_template:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
target:
entity_id: input_datetime.espressomachine_starttijd