Romain meant that the reload time should be larger than the expected
play time of the playlist. For example, you use the first playlist for
1h30-3h30, that is 2 hours long. If you set a reload time of 3 hours,
the playlist could be reloaded before the next day but after the end
of the 2 hours time slot. However, it won't work exactly this way: the
reloading event is triggered when the playlist is used, so it would
happen when you come back to that playlist.

I guesed that playlist will reload when the time played for that playlist = reload time.

I wanted to make a single transition function and to use
source.id(source) and execute
But it's not that simple. Almost everytime source id is empy_xxxx,
src_xxxx, even if I gave an explicit id for all sources/playlists used.
Probably because the sources called playlist in your switch are not
directly the playlists, but are possibly wrapped in various operators.
In that case, having just one transition and using it for all sources
should work, but can't be based on ids. Instead, you can pass a first
parameter to your transition that gives the id of the actual playlist:
you transition function would be of the form f(id,before,after) and
you partially apply it for each instance of it, ie.
transitions=[f("pl1"),f("pl2")...] where those strings are the ids
that should be used for reloading.

I still get empty source ids if I use the code below.

playlist_small1 = playlist(id="small1",mode="normal","/etc/liquidsoap/playlists/airtime_small1.txt")
playlist_small2 = playlist(id="small2",mode="normal","/etc/liquidsoap/playlists/airtime_small2.txt")
playlist_small3 = playlist(id="small3",mode="normal","/etc/liquidsoap/playlists/airtime_small3.txt")
playlist_small4 = playlist(id="small4",mode="normal","/etc/liquidsoap/playlists/airtime_small4.txt")

def reload_playlist(a,b)
        log("a.id = #{source.id(a)} b.id = #{source.id(b)}")

playlists_switch = switch(transitions=[reload_playlist,reload_playlist,reload_playlist,reload_playlist],
                        ({22h30-22h35},     playlist_small1),
                        ({22h35-22h40},   playlist_small2),
                        ({22h40-22h45},  playlist_small3),
                        ({22h45-22h50},  playlist_small4)

#icecast output
icecast_output = fallback(id="fallback_live_playlists",track_sensitive=true,replay_metadata=false,[playlists_switch,safe_playlist])
Anyway, I followed your advice and managed to make the transition function. I would have never tried to make a function with three parameters for a transition because in the doc I read:
transitions ([(source('a),source('a))->source('a)] – defaults to []): Transition functions, padded with fun (x,y) -> y functions.
I think the documentation needs to be improved.

What you see here is the default id, based on the filename. If you set
an id by hand, ie. use playlist(id="foo","playlist.txt"), then you'll
see the id. The only exception is when there is a conflict, the final
id might be foo.1, foo.2, etc. Note that the variable names used for
the source have nothing to do with the id: if you do
playlist_0130_0330 = playlist("playlist.txt"), the id will not be

This was my mistake. To be sure that nothing bad happens because one source is mono and another one stereo I added audio_to_stereo to all my playlists.
small_playlist = audio_to_stereo(id="small_stereo", playlist("..../small.txt")) -> Wrong.