I assume you mean ‘turn off’ after a delay?
Your first action turns it on.
If so, use two automations:
Turn on
alias: VVB Av etter en time
description: ''
trigger:
- platform: time
at: input_datetime.billigtime1
- platform: time
at: input_datetime.billigtime2
- platform: time
at: input_datetime.billigtime3
- platform: time
at: input_datetime.billigtime4
- platform: time
at: input_datetime.billigtime5
- platform: time
at: input_datetime.billigtime6
- platform: time
at: input_datetime.billigtime7
- platform: time
at: input_datetime.billigtime8
- platform: time
at: input_datetime.billigtime9
- platform: time
at: input_datetime.billigtime10
- platform: time
at: input_datetime.billigtime11
- platform: time
at: input_datetime.billigtime12
condition: []
action:
- service: switch.turn_on
target:
entity_id: switch.varmtvannstank
- service: notify.mobile_app_thomas_mobil
data:
title: 'VVB PÅ Billig '
message: '{{now()}}'
mode: single
Turn off:
alias: Turn off after 59 minutes
trigger:
- platform: state
entity_id: switch.varmtvannstank
to: 'on'
for:
minutes: 59
action:
- service: switch.turn_off
target:
entity_id: switch.varmtvannstank
- service: notify.mobile_app_thomas_mobil
data:
title: VVB AV 59min
message: '{{now()}}'
mode: single
This trigger off for time will be reset and start counting again if automations are reloaded or when Home Assistant restarts.
If the time is super critical you could start a timer in the “turn on” automation and use the timer finishing as the trigger for your off automation. The timer will not be affected by automation reloads and there is a method to restore active timers after a restart, see: https://community.home-assistant.io/t/restore-active-paused-timers-after-a-restart/274439