Adding multiple timers

I’m having another go at setting up some lights and trying to use multiple timers for this as it seems they should do the job. I still haven’t gotten to grips with Yaml. I just don’t use it enough to really understand some of the details. Is this how you do it?

timer:
  - alias: porch_timer
    duration: '00:02:00'
  - alias: front_timer
    duration: '00:02:00'

I’ve tried several variations on this. Most gave some variation on “mapping values are not allowed here” in the log.

I did try searching for this without much success. In general it would be good to see more examples in the documentation. We have the list of example configurations people have shared, but those could do with some annotation to indicate how old they are and what sort of features they include.

I’m eager to exploit the power of HA and as a professional developer I’d expect to be able to do that, but I just find the configuration complicated.

Cheers for any hints.

timer:
  porch_timer:
    duration: '00:02:00'

  front_timer:
    duration: '00:02:00'
1 Like

Thanks, that did it. Just need to get the other parts working now :slight_smile:

1 Like

Hi,

A newbie question here.
When I add one timer, I can see and use the related timer.xxx services. Bit when I configure multiple timers (as described above), the timers appear as entities but the timer services are not there anymore.
What could I possibly do wrong? The entries in my config yaml look like this

# Timers
timer:
  officepresence:
    duration: '00:10:00'
    
  dressingtimer:
    duration: '05:00:00'
    
  laaanliv:
    duration: '00:10:00'
    
  garagebewsensor:
    duration: '00:10:00'
    
  garagedeurcontact:
    duration: '00:10:00'
    

For the record, I solved my problem. Apparently, the blank lines separating the different timers contained some spaces. Removing those solved my problem.