Optocouplers with triac and thyristor output