Timer to turn on/off an entity that lasts more than 60 minutes

Hi,
I have several timers that turn off automatically certain entities (e.g., the fan of the bathroom).
I would like to have a slider with minutes in input but >60 minutes.
I have tried to set something like 100 minutes but it is “limited” to 60 anyway.
Do you have any workaround to fix this?

Many thanks!

My code for the timer:

automations.yaml:

- id: cf063a3a5d984cb7a3bc85d225b0a5b0
  alias: Bathroom ventilation timer
  description: ''
  trigger:
  - entity_id: fan.bathroom_ventilation
    for:
      minutes: '{{ states(''input_number.bathroom_ventilation_timer'')|int }}'
    platform: state
    to: 'on'
  condition: []
  action:
  - data: {}
    entity_id: fan.bathroom_ventilation
    service: homeassistant.turn_off
  mode: single

Then I have an input_number with a slider that ranges from 10 to 120 and an input_boolean to turn on/off the automation.

120 is two hours so maybe you are mentioning the specs for a different input_number? Go into helpers under settings and change it to whatever you want such as an upper limit of 240 (4 hours)? And/or maybe you have an automation that is setting it back to an hour sometimes?

for: '{{ states(''input_number.bathroom_ventilation_timer'') | int | multiply(60) | timestamp_custom(''%H:%M:%S'', false) }}'

Many thanks @petro, but won’t this take only the value in hours? Are fractions of an hour an accepted value (e.g. 1.5:00:00)?
@KruseLuds: I tried that but it doesn’t work

Yes, it does

So if I input 90 minutes will it take 1h or 1.5h as value?

Yes… just try it

Aaaaah as I understand it multiplies the minutes expressed in the input_number and multiplies it by 60 making them seconds. Then, it takes the seconds as if it were UNIX time and converts it to hh:mm:ss.
I’ll give it a try and let you know!

Correct, that’s exactly what it does. So it won’t work if you go over 24 hours.

Not sure what you tried, but it does for me :slight_smile:

@petro it works!
@KruseLuds I don’t know but it’s the first thing I tried and I couldn’t make it work!