The 30-year-old Vaud man went to fight for the Islamic State (Isis) in December 2013 after being converted to the cause through a French recruitment site on the internet, the broadcaster said.
He returned from Syria three months later, although he stayed in a training camp for the terrorist group for only two weeks.
When he decided to quit he was imprisoned by Isis colleagues before being able to leave, RTS said.
The federal prosecutor outlined the penalty against the man, which includes counselling from a psychiatrist.
The decision marks the first time in Switzerland that an ex-jihadist returning from Syria has been processed by the Swiss criminal system.
He was penalized under a criminal ordinance that came into effect this week.
The penalty compares with stiff prison terms meted out in recent days to jihadists who returned to Britain and Germany, as well as one in France last month.
The Vaud man cooperated with Swiss authorities from the outset and has stated that he cut all ties with his former Isis colleagues, RTS said.
On Monday, the lower house of parliament extended a law banning al-Qaeda and Isis to ensure the prohibition continues for at least four years.
The senate earlier approved the ban, to become effective in January, which will replace a shorter-term parliamentary ordinance.